]> git.pond.sub.org Git - empserver/commitdiff
trade: Don't increase negative mobility to zero on trade
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 10 Aug 2017 04:45:42 +0000 (06:45 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 12 Aug 2017 06:07:44 +0000 (08:07 +0200)
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>
info/Bugs.t
src/lib/commands/trad.c

index 4061a1edc7f0fa070599fc2e7e67931791acd109..9e9cf1073dd833e64463cbc115e11d63d00af2df 100644 (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,
 it will go on the trading market automatically.
 .s1
-If a plane has negative mobility, then gets traded, mobility
-goes to 0.
-.s1
 If two countries are cooperating,
 its possible to raid an enemy airport and steal the planes
 by putting them out to trade.
index 2e24a29b82d69c67b5c1f5587fef278af7065eae..a760886a5ef0d8df00ea8e2abb3c196f45a804ad 100644 (file)
@@ -358,7 +358,7 @@ check_trade(void)
            if (opt_MOB_ACCESS) {
                tg.plane.pln_mobil = -(etu_per_update / sect_mob_neg_factor);
                game_tick_to_now(&tg.plane.pln_access);
-           } else {
+           } else if (tg.plane.pln_mobil > 0) {
                tg.plane.pln_mobil = 0;
            }
            tg.plane.pln_harden = 0;
@@ -373,7 +373,7 @@ check_trade(void)
            if (opt_MOB_ACCESS) {
                tg.land.lnd_mobil = -(etu_per_update / sect_mob_neg_factor);
                game_tick_to_now(&tg.land.lnd_access);
-           } else {
+           } else if (tg.plane.pln_mobil > 0) {
                tg.land.lnd_mobil = 0;
            }
            tg.land.lnd_harden = 0;