]> git.pond.sub.org Git - empserver/commitdiff
retreat: Clear mission only when ship or land unit moves
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 20 Jan 2014 20:05:57 +0000 (21:05 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 16 Feb 2014 12:19:25 +0000 (13:19 +0100)
The mission gets cleared whenever a retreat is triggered, even for
ships and land units that are unable to retreat.

Clear it only when the ship or land unit actually retreats.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/retreat.c
tests/retreat/final.xdump
tests/retreat/journal.log

index 6310c43373a02c3eee85aee310adddf6ce5ed56f..ca95bd5d6953b9eda3c608da275b4ca6d4b75143 100644 (file)
@@ -140,7 +140,6 @@ retreat_ship1(struct shpstr *sp, char code, int orig)
     struct mchrstr *mcp;
     int changed;
 
-    sp->shp_mission = 0;
     if (sp->shp_own == 0)
        return 0;
 
@@ -260,6 +259,7 @@ retreat_ship1(struct shpstr *sp, char code, int orig)
        sp->shp_x = newx;
        sp->shp_y = newy;
        sp->shp_mobil -= mobcost;
+       sp->shp_mission = 0;
        if (stopping)
            continue;
 
@@ -399,7 +399,6 @@ retreat_land1(struct lndstr *lp, char code, int orig)
     double mobcost;
     struct lchrstr *lcp;
 
-    lp->lnd_mission = 0;
     if (lp->lnd_own == 0)
        return 0;
 
@@ -471,6 +470,7 @@ retreat_land1(struct lndstr *lp, char code, int orig)
        lp->lnd_x = newx;
        lp->lnd_y = newy;
        lp->lnd_mobil -= mobcost;
+       lp->lnd_mission = 0;
        if (stopping)
            continue;
 
index 62e9804f84fdda4bedc2106e0a9fdea10d659fa7..37377840ed0569e157357d730e03dda50af857ab 100644 (file)
@@ -189,7 +189,7 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet xstar
 39 0 0 0 0 0 127 0 0 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 0 "" 0 0 0 () ""
 40 2 1 3 10 91 -7 0 45 0 2 none 1 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 40 "" -3 1 1 (injured) "nnnh"
 41 2 1 3 10 96 108 0 45 0 2 none 1 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 41 "" -3 1 1 (injured) "h"
-42 2 -4 2 10 95 120 0 45 -4 2 none 1 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 42 "" -3 1 1 (injured) "gggh"
+42 2 -4 2 10 95 120 0 45 -4 2 interdiction 1 "" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 42 "" -3 1 1 (injured) "gggh"
 43 2 -6 4 16 71 80 0 40 0 0 none 0 "m" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 2 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 43 "" -3 1 1 (group injured) "g"
 44 2 -6 4 16 69 74 0 40 0 0 none 0 "m" 0 0 0 0 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 3 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 44 "" -3 1 1 (group injured) "g"
 45 0 0 0 0 0 127 0 0 0 0 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 0 "" 0 "" 0 0 0 () ""
@@ -395,7 +395,7 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship h
 39 0 0 0 0 0 127 0 0 0 0 none 0 "" -1 127 0 () "" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 40 2 2 2 0 89 -15 0 50 1 1 none 3 "" -1 127 42 (bombed) "u" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 41 2 3 1 0 86 99 0 50 1 1 none 3 "" -1 127 42 () "" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-42 2 1 1 0 83 105 0 50 1 1 none 3 "" -1 127 42 () "" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+42 2 1 1 0 83 105 0 50 1 1 reserve 3 "" -1 127 42 () "" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 43 2 0 0 15 97 111 0 130 0 0 none 0 "m" -1 127 42 (group bombed) "u" 0 10 3 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 44 2 0 0 15 89 102 0 130 0 0 none 0 "m" -1 127 42 (group bombed) "u" 0 10 2 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 45 0 0 0 0 0 127 0 0 0 0 none 0 "" -1 127 0 () "" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
index be5e7278bf3f0f603e9d89c523860e1bdb6a5102..92bd0e77c88d0ab3e7a26688440b4df988cf8379 100644 (file)
     Play#0 output Play#0 6 0 639
     Play#0 input miss s * ?mission#0 q
     Play#0 command mission
+    Play#0 output Play#0 1 Thing                        x,y     op-sect  rad mission
+    Play#0 output Play#0 1 lc   light cruiser (#42)    -4,2      -4,2      1 is on an interdiction mission
     Play#0 output Play#0 6 0 637
     Play#0 input land * ?army#a
     Play#0 command land
     Play#0 output Play#0 6 0 636
     Play#0 input miss l * ?mission#0 q
     Play#0 command mission
+    Play#0 output Play#0 1 Thing                        x,y     op-sect  rad mission
+    Play#0 output Play#0 1 cav  cavalry #42             1,1       1,1      3 is on a reserve mission
     Play#0 output Play#0 6 0 634
     Play#0 input ctld
     Play#0 output Play#0 1 Bye-bye