]> git.pond.sub.org Git - empserver/commitdiff
retreat lretreat: Strip trailing 'h' from retreat path
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 10 Jan 2015 09:03:33 +0000 (10:03 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:49 +0000 (08:20 +0100)
Has no effect now.  Before the recent rewrite of automatic retreat, it
could be used to trigger group retreat while staying put.

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

index 326419db33c234e9a02566cfc6f5c1c948f5a6e1..0b08a7454de14ad8eddd7b69621d3c51bf06e3c6 100644 (file)
@@ -71,8 +71,7 @@ retreat(int type)
     int nunits;
     struct nstr_item ni;
     union empobj_storage unit;
-    int rflags, ch, j;
-    unsigned i;
+    int i, rflags, ch, j;
     char *rflagsc, *p, *name, *rpath, *what;
     int *rflagsp;
     char buf1[1024];
@@ -96,6 +95,8 @@ retreat(int type)
                return RET_SYN;
            }
        }
+       for (i--; i >= 0 && pq[i] == dirch[DIR_STOP]; i--)
+           pq[i] = 0;
     } else
        pq = NULL;
 
index ff8e693c9f4c17d3cccd05c7e7b9046185f3ae8c..1f1750e0d280142071df8288f93f7d011b75f728 100644 (file)
@@ -50,9 +50,9 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil
 34 2 3 1 10 94 120 0 45 3 1 interdiction 1 "" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (injured) "n"
 35 2 0 2 10 100 0 0 45 0 2 interdiction 1 "c" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (group injured) "n"
 36 2 0 2 10 100 127 0 45 0 2 interdiction 1 "c" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (group injured) "n"
-40 2 1 3 10 91 -7 0 45 0 2 none 1 "" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (injured) "nnnh"
-41 2 1 3 10 96 109 0 45 0 2 none 1 "" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (injured) "uh"
-42 2 -4 2 10 95 121 0 45 -4 2 interdiction 1 "" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (injured) "ugggh"
+40 2 1 3 10 91 -7 0 45 0 2 none 1 "" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (injured) "nnn"
+41 2 1 3 10 96 109 0 45 0 2 none 1 "" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (injured) "u"
+42 2 -4 2 10 95 121 0 45 -4 2 interdiction 1 "" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (injured) "uggg"
 43 2 -6 4 16 87 98 0 45 0 0 none 0 "m" 0 8 1 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (group injured) "g"
 44 2 -6 4 16 68 73 0 45 0 0 none 0 "m" 0 6 2 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (group injured) "g"
 46 2 5 1 10 93 118 0 45 5 1 interdiction 1 "n" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" -3 1 1 (group injured) "y"
@@ -118,8 +118,8 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship h
 10 2 3 -1 0 42 29 0 50 1 1 none 3 "" -1 0 42 () "" 0 4 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 24 1 3 1 0 98 125 0 50 0 0 none 0 "g" -1 0 42 (group bombed) "bhg" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 25 2 2 2 0 91 96 0 50 3 1 none 3 "g" -1 0 42 (group bombed) "g" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-26 2 3 1 0 100 127 0 50 3 1 reserve 3 "g" -1 127 42 (bombed) "uh" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-27 2 3 1 0 100 127 0 50 3 1 reserve 3 "g" -1 127 42 (group bombed) "uh" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+26 2 3 1 0 100 127 0 50 3 1 reserve 3 "g" -1 127 42 (bombed) "u" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+27 2 3 1 0 100 127 0 50 3 1 reserve 3 "g" -1 127 42 (group bombed) "u" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 28 2 2 2 0 100 107 0 50 3 1 none 3 "g" -1 0 42 (group injured) "g" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 29 2 4 0 0 100 127 0 50 4 0 reserve 3 "g" -1 127 42 (group bombed) "bhg" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 30 0 0 2 0 0 105 0 50 0 2 reserve 3 "c" -1 127 42 (group bombed) "j" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
@@ -137,7 +137,7 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship h
 44 2 1 -1 15 90 76 0 130 1 1 none 1 "m" -1 0 42 () "" 0 9 3 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 45 2 1 -1 7 84 65 0 50 0 0 none 0 "t" -1 0 42 (group bombed) "b" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 46 2 0 -2 0 100 127 0 50 0 -2 reserve 3 "t" -1 127 42 (group bombed) "nb" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-47 2 1 -1 0 91 115 0 50 1 -1 reserve 3 "s" -1 127 42 (group bombed) "gh" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+47 2 1 -1 0 91 115 0 50 1 -1 reserve 3 "s" -1 127 42 (group bombed) "g" 0 9 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 48 2 -1 -1 8 100 116 0 50 1 -1 none 3 "s" -1 0 42 () "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 60 2 3 1 0 73 72 0 50 0 0 none 3 "" -1 0 42 () "" 0 7 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 61 2 0 0 0 100 127 0 50 0 0 reserve 3 "" -1 127 42 (injured helpless bombed) "nj" 0 10 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
index 918643a207a71e3cf99ab58e5ae6cbe77903dc15..f5b9e07632c98c78fc6abf2e363bd2386297cc60 100644 (file)
     Play#0 output Play#0 1 1 planes spotted over 1,-1
     Play#0 output Play#0 1 1 pinpoint bombing raid did 24 damage to cav  cavalry #47
     Play#0 output Play#0 1     cav  cavalry #47 takes 9
-    Play#0 output Play#0 1 cav  cavalry #47 retreats along path gh
+    Play#0 output Play#0 1 cav  cavalry #47 retreats along path g
     Play#0 output Play#0 1 spy  infiltrator #48 retreats with them
     Play#0 output Play#0 1 cav  cavalry #47 can't go to -1,-1 & stays in 1,-1
     Play#0 output Play#0 1 spy  infiltrator #48 stopped at -1,-1
     Play#0 output Play#0 1   2   34 lc   light cruis    3,1      n                   i
     Play#0 output Play#0 1   2   35 lc   light cruis    0,2    c n          Yes      i
     Play#0 output Play#0 1   2   36 lc   light cruis    0,2    c n          Yes      i
-    Play#0 output Play#0 1   2   40 lc   light cruis    1,3      nnnh                i
-    Play#0 output Play#0 1   2   41 lc   light cruis    1,3      uh                  i
-    Play#0 output Play#0 1   2   42 lc   light cruis   -4,2      ugggh               i
+    Play#0 output Play#0 1   2   40 lc   light cruis    1,3      nnn                 i
+    Play#0 output Play#0 1   2   41 lc   light cruis    1,3      u                   i
+    Play#0 output Play#0 1   2   42 lc   light cruis   -4,2      uggg                i
     Play#0 output Play#0 1   2   43 ms   minesweeper   -6,4    m g          Yes      i
     Play#0 output Play#0 1   2   44 ms   minesweeper   -6,4    m g          Yes      i
     Play#0 output Play#0 1   2   46 lc   light cruis    5,1    n y          Yes      i
     Play#0 output Play#0 1   1    7 inf  infantry      -4,0    a b          Yes      h
     Play#0 output Play#0 1   1   24 cav  cavalry        3,1    g bhg        Yes      b
     Play#0 output Play#0 1   2   25 cav  cavalry        2,2    g g          Yes      b
-    Play#0 output Play#0 1   2   26 cav  cavalry        3,1    g uh                  b
-    Play#0 output Play#0 1   2   27 cav  cavalry        3,1    g uh         Yes      b
+    Play#0 output Play#0 1   2   26 cav  cavalry        3,1    g u                   b
+    Play#0 output Play#0 1   2   27 cav  cavalry        3,1    g u          Yes      b
     Play#0 output Play#0 1   2   28 cav  cavalry        2,2    g g          Yes      i
     Play#0 output Play#0 1   2   29 cav  cavalry        4,0    g bhg        Yes      b
     Play#0 output Play#0 1   2   31 cav  cavalry        0,2    c j          Yes      b
     Play#0 output Play#0 1   2   42 cav  cavalry        1,1      g                   b
     Play#0 output Play#0 1   2   45 tra  train          1,-1   t b          Yes      b
     Play#0 output Play#0 1   2   46 cav  cavalry        0,-2   t nb         Yes      b
-    Play#0 output Play#0 1   2   47 cav  cavalry        1,-1   s gh         Yes      b
+    Play#0 output Play#0 1   2   47 cav  cavalry        1,-1   s g          Yes      b
     Play#0 output Play#0 1   2   61 cav  cavalry        0,0      nj                  ihb
     Play#0 output Play#0 1   2   62 cav  cavalry        0,0      nj                  ihb
     Play#0 output Play#0 1   2   63 cav  cavalry        0,0      nj                  ihb