trade: Don't increase negative mobility to zero on trade

check_trade() sets plane and land unit mobility to zero on trade.
Even when it's negative.  Fix to leave it alone then.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2017-08-10 06:45:42 +02:00
parent 9a535b3d29
commit 8637ef93b3
2 changed files with 2 additions and 5 deletions

View file

@ -16,9 +16,6 @@ If a ship, plane, land unit or nuke is out to trade, and gets
destroyed, and its owner builds a new one that gets the same number, destroyed, and its owner builds a new one that gets the same number,
it will go on the trading market automatically. it will go on the trading market automatically.
.s1 .s1
If a plane has negative mobility, then gets traded, mobility
goes to 0.
.s1
If two countries are cooperating, If two countries are cooperating,
its possible to raid an enemy airport and steal the planes its possible to raid an enemy airport and steal the planes
by putting them out to trade. by putting them out to trade.

View file

@ -358,7 +358,7 @@ check_trade(void)
if (opt_MOB_ACCESS) { if (opt_MOB_ACCESS) {
tg.plane.pln_mobil = -(etu_per_update / sect_mob_neg_factor); tg.plane.pln_mobil = -(etu_per_update / sect_mob_neg_factor);
game_tick_to_now(&tg.plane.pln_access); game_tick_to_now(&tg.plane.pln_access);
} else { } else if (tg.plane.pln_mobil > 0) {
tg.plane.pln_mobil = 0; tg.plane.pln_mobil = 0;
} }
tg.plane.pln_harden = 0; tg.plane.pln_harden = 0;
@ -373,7 +373,7 @@ check_trade(void)
if (opt_MOB_ACCESS) { if (opt_MOB_ACCESS) {
tg.land.lnd_mobil = -(etu_per_update / sect_mob_neg_factor); tg.land.lnd_mobil = -(etu_per_update / sect_mob_neg_factor);
game_tick_to_now(&tg.land.lnd_access); game_tick_to_now(&tg.land.lnd_access);
} else { } else if (tg.plane.pln_mobil > 0) {
tg.land.lnd_mobil = 0; tg.land.lnd_mobil = 0;
} }
tg.land.lnd_harden = 0; tg.land.lnd_harden = 0;