retreat: Clear mission only when ship or land unit moves

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>
This commit is contained in:
Markus Armbruster 2014-01-20 21:05:57 +01:00
parent 2cc0664e3e
commit e7949e20f3
3 changed files with 8 additions and 4 deletions

View 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;

View 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

View file

@ -1581,6 +1581,8 @@
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
@ -1630,6 +1632,8 @@
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