]> git.pond.sub.org Git - empserver/commitdiff
march: Fix 'm' not to leave engineer without mobility behind
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 29 Dec 2014 16:36:36 +0000 (17:36 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 28 Feb 2015 15:13:15 +0000 (16:13 +0100)
When lnd_sweep() rejects an engineer for want of mobility, it removes
it from the list of units.

Can happen only when sweeping for march sub-command 'm'.  Any engineer
without mobility is dropped from the march immediately.  Broken in
Empire 2.

Fix lnd_sweep() to handle this case just like the others, and like
shp_sweep(): report and continue with the next list member.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/lndsub.c
tests/navi-march/02-march-1
tests/navi-march/journal.log

index 7fcd9c4113b62f790b17f5fc66b56f2efa6deaa1..9470dffda74c1aad9c36e9be77d64bce867502b7 100644 (file)
@@ -602,7 +602,8 @@ lnd_sweep(struct emp_qelem *land_list, int explicit, int takemob,
        }
        if (takemob && llp->mobil <= 0.0) {
            if (explicit)
-               lnd_stays(actor, "is out of mobility", llp);
+               mpr(actor, "%s is out of mobility!\n",
+                   prland(&llp->unit.land));
            continue;
        }
        getsect(llp->unit.land.lnd_x, llp->unit.land.lnd_y, &sect);
index 6aee63b18e74f440dc734fb9e56ed618b799c51e..baff6b74a17fbe026f96be37d9c3baad66e6ce7d 100644 (file)
@@ -118,7 +118,6 @@ march 120 mh
 march 121/128 j
 | explicit sweep of same, out of mob
 mi
-| BUG: 128 stays behind
 | no implicit sweep in old-owned 7,7
 g
 | explicit sweep in same
index d325f0f38e17aeabe638a38de6d491169a80abf8..a8a5a1d6567877be88348c56a7a138e0cabafdc1 100644 (file)
     Play#1 output Play#1 1 Sweep...
     Play#1 output Play#1 1 Sweep...
     Play#1 output Play#1 1 Sweep...
-    Play#1 output Play#1 1 eng  engineer #128 is out of mobility & stays in 9,7
+    Play#1 output Play#1 1 eng  engineer #128 is out of mobility!
     Play#1 output Play#1 1 lnd#     land type       x,y    a  eff mil  sh gun xl ln  mu tech retr
     Play#1 output Play#1 1  121 eng  engineer       9,7      100%   5   3   0  0  0  77 130  42%
+    Play#1 output Play#1 1  128 eng  engineer       9,7      100%   5   0   0  0  0 -23 130  42%
     Play#1 output Play#1 1  m m
     Play#1 output Play#1 1 m m m
     Play#1 output Play#1 1  . .
-    Play#1 output Play#1 4 <77.3:77.3: 9,7>
+    Play#1 output Play#1 4 <77.3:-23.8: 9,7>
     Play#1 input g
+    Play#1 output Play#1 1 eng  engineer #128 is out of mobility & stays in 9,7
     Play#1 output Play#1 1  m m
     Play#1 output Play#1 1 m m m
     Play#1 output Play#1 1  . .