]> git.pond.sub.org Git - empserver/commitdiff
navigate march: Fix use-after-free and other bugs
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 5 Jan 2015 15:32:25 +0000 (16:32 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Mon, 2 Mar 2015 07:20:47 +0000 (08:20 +0100)
unit_move() is too big and has too many paths through its loop.
Maintenance of the (unspoken) loop invariant isn't obvious.  In fact,
it isn't maintained on some paths.  I found several bugs:

* We check prerequisite conditions for moving before the first move
  and around prompts.  When a condition becomes wrong on the move,
  movement continues all the same until the next prompt.  I believe
  the only way this can happen is loss of crew due to hitting a mine.

* We cache ships and land units in a list of struct ulist.  When a
  ship or land unit gets left behind, its node is removed from the
  list and freed.

  We keep pointer flg pointing to the flagship in that list for
  convenience.  However, the pointer isn't updated until the next
  prompt.  It's referenced for automatic radar and all sub-commands
  other than the six directions and 'h'.  Use after free when such a
  sub-command gets processed after a flagship change without a prompt.
  Same for land units.  For instance, navigating a pair of ships "jh"
  where the flagship has no mobility leaves the flagship behind, then
  attempts to radar automatically using the ship in the freed list
  node.  Likewise, marching a similar pair of land units "jl" examines
  the land unit in the freed list node to figure out how to look.

* We cache mobility in the same list to support fractional mobility
  during movement.  Movement deducts from cached mobility and writes
  the result back to the ship or land unit.

  If something else charges it mobility while it's in this list, the
  cache becomes stale.  shp_nav() and lnd_nav() reload stale caches,
  but don't run often enough.  For instance, when a ship hits mines,
  the mine damage makes the cache stale.  If a direction or 'h'
  follows directly, the stale mobility is written back, clobbering the
  mine hit's mobility loss.

This mess dates back to Empire 2, where it replaced a different mess.
There may be more bugs.

unit_move()'s complex control flow makes reasoning about its loop
invariant too error-prone.  Rewrite the mess instead, splitting off
sensible subroutines.

Also fixes a couple of minor annoyances:

* White-space can confuse the parser.  For instance, "jg l" is
  interpreted like "jgll".  Fix to reject the space.  Broken in commit
  0c12d83, v4.3.7.

* The flagship uses radar automatically before any sub-command (since
  Chainsaw), and all ships use it automatically after a move (since
  4.2.2).  Make them all use it before and after each sub-command,
  whether it's a move or not.

* Land units don't use radar automatically.  Make them use it just
  like ships.

* Always report a flagship / leader change right when it happens, not
  only before and after a prompt.

Left for another day, marked FIXME: BTU charging is unclean.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
13 files changed:
include/land.h
include/ship.h
include/unit.h
src/lib/commands/marc.c
src/lib/commands/navi.c
src/lib/subs/lndsub.c
src/lib/subs/shpsub.c
src/lib/subs/unitsub.c
tests/navi-march/01-navigate-1
tests/navi-march/02-march-1
tests/navi-march/final.xdump
tests/navi-march/journal.log
tests/smoke/journal.log

index 5e52905a55ef093e055354746dc193ac73f2653d..cf26f82fe663a6c5d78d9bf126e58393b73fbcf9 100644 (file)
@@ -193,7 +193,7 @@ extern void lnd_submil(struct lndstr *, int);
 extern void lnd_takemob(struct emp_qelem *, double);
 extern int lnd_spyval(struct lndstr *);
 extern void intelligence_report(int, struct lndstr *, int, char *);
-extern void lnd_mar(struct emp_qelem *, double *, double *, natid);
+extern void lnd_mar(struct emp_qelem *, natid);
 extern void lnd_put(struct emp_qelem *);
 extern void lnd_put_one(struct ulist *);
 extern int lnd_hardtarget(struct lndstr *);
index 98a5b7ca07967824776bb20e2776c37f22f8ab55..90427b49412e267d90a67473de5cdfe6c6685d71 100644 (file)
@@ -172,7 +172,7 @@ extern double shp_torp_hitchance(struct shpstr *, int);
 extern int shp_may_nav(struct shpstr *, struct shpstr *, char *);
 extern void shp_sel(struct nstr_item *, struct emp_qelem *);
 extern struct ulist *shp_insque(struct shpstr *, struct emp_qelem *);
-extern void shp_nav(struct emp_qelem *, double *, double *, natid);
+extern void shp_nav(struct emp_qelem *, natid);
 extern int shp_sweep(struct emp_qelem *, int, int, natid);
 extern enum shp_stuck shp_check_nav(struct shpstr *, struct sctstr *);
 extern int sect_has_dock(struct sctstr *);
index b77d7b51fa4941e7e6f568d1d378e6ec3ef31cdb..9d6d5bf31c9b7b254fea46257a88c780f9f766ac 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Ron Koenderink, 2006-2007
- *     Markus Armbruster, 2006-2014
+ *     Markus Armbruster, 2006-2015
  */
 
 #ifndef UNIT_H
@@ -56,7 +56,8 @@ extern int unit_nplane(int, int, int *, int *, int *);
 extern void unit_onresize(int);
 
 extern char *unit_nameof(struct empobj *);
-extern int unit_move(struct emp_qelem *, double *, double *);
+extern void unit_rad_map_set(struct emp_qelem *);
+extern int unit_move(struct emp_qelem *);
 extern void unit_teleport(struct empobj *, coord, coord);
 extern int unit_update_cargo(struct empobj *);
 extern void unit_drop_cargo(struct empobj *, natid);
index e2afb38c3d6dce7712d738b099c8246f6641c1f0..e1c1b6712fdbceeaba17958f0a6684dc33950a55 100644 (file)
@@ -30,6 +30,7 @@
  *     Thomas Ruschak
  *     Ken Stevens, 1995 (rewrite)
  *     Ron Koenderink, 2006-2007
+ *     Markus Armbruster, 2006-2015
  */
 
 #include <config.h>
@@ -42,15 +43,13 @@ march(void)
 {
     struct nstr_item ni_land;
     struct emp_qelem land_list;
-    double minmob, maxmob;
 
     if (!snxtitem(&ni_land, EF_LAND, player->argp[1], NULL))
        return RET_SYN;
     lnd_sel(&ni_land, &land_list);
-    lnd_mar(&land_list, &minmob, &maxmob, player->cnum);
     if (QEMPTY(&land_list)) {
        pr("No lands\n");
        return RET_FAIL;
     }
-    return unit_move(&land_list, &minmob, &maxmob);
+    return unit_move(&land_list);
 }
index 833f74464242dc8df58a79f818937b2a9e7ae41b..8a65f2ee0948369e95dfdc332c262980634334d8 100644 (file)
@@ -29,7 +29,7 @@
  *  Known contributors to this file:
  *     Ken Stevens, 1995 (rewritten)
  *     Ron Koenderink, 2006-2007
- *     Markus Armbruster, 2006-2014
+ *     Markus Armbruster, 2006-2015
  */
 
 #include <config.h>
@@ -42,15 +42,13 @@ navi(void)
 {
     struct nstr_item ni_ship;
     struct emp_qelem ship_list;
-    double minmob, maxmob;
 
     if (!snxtitem(&ni_ship, EF_SHIP, player->argp[1], NULL))
        return RET_SYN;
     shp_sel(&ni_ship, &ship_list);
-    shp_nav(&ship_list, &minmob, &maxmob, player->cnum);
     if (QEMPTY(&ship_list)) {
        pr("No ships\n");
        return RET_FAIL;
     }
-    return unit_move(&ship_list, &minmob, &maxmob);
+    return unit_move(&ship_list);
 }
index 0fd6b7830fd4d36f4c65b3078c64bb5a18680a72..7d57dc718f75873897b0886d6435913a53323d3c 100644 (file)
@@ -527,10 +527,8 @@ lnd_insque(struct lndstr *lp, struct emp_qelem *list)
     return mlp;
 }
 
-/* This function assumes that the list was created by lnd_sel */
 void
-lnd_mar(struct emp_qelem *list, double *minmobp, double *maxmobp,
-       natid actor)
+lnd_mar(struct emp_qelem *list, natid actor)
 {
     struct emp_qelem *qp;
     struct emp_qelem *next;
@@ -538,8 +536,6 @@ lnd_mar(struct emp_qelem *list, double *minmobp, double *maxmobp,
     struct lndstr *lp, *ldr = NULL;
     char and_stays[32];
 
-    *minmobp = 9876.0;
-    *maxmobp = -9876.0;
     for (qp = list->q_back; qp != list; qp = next) {
        next = qp->q_back;
        llp = (struct ulist *)qp;
@@ -566,10 +562,6 @@ lnd_mar(struct emp_qelem *list, double *minmobp, double *maxmobp,
        if (lp->lnd_mobil + 1 < (int)llp->mobil) {
            llp->mobil = lp->lnd_mobil;
        }
-       if (llp->mobil < *minmobp)
-           *minmobp = llp->mobil;
-       if (llp->mobil > *maxmobp)
-           *maxmobp = llp->mobil;
     }
 }
 
index 1ab137f15499f9fd20d2c78d684348e3a24d866f..e8f39137eda8c1ea733b9a814b315860401a61d5 100644 (file)
@@ -160,10 +160,8 @@ shp_insque(struct shpstr *sp, struct emp_qelem *list)
     return mlp;
 }
 
-/* This function assumes that the list was created by shp_sel */
 void
-shp_nav(struct emp_qelem *list, double *minmobp, double *maxmobp,
-       natid actor)
+shp_nav(struct emp_qelem *list, natid actor)
 {
     struct emp_qelem *qp;
     struct emp_qelem *next;
@@ -171,8 +169,6 @@ shp_nav(struct emp_qelem *list, double *minmobp, double *maxmobp,
     struct shpstr *sp, *flg = NULL;
     char and_stays[32];
 
-    *minmobp = 9876.0;
-    *maxmobp = -9876.0;
     for (qp = list->q_back; qp != list; qp = next) {
        next = qp->q_back;
        mlp = (struct ulist *)qp;
@@ -199,10 +195,6 @@ shp_nav(struct emp_qelem *list, double *minmobp, double *maxmobp,
        if (sp->shp_mobil + 1 < (int)mlp->mobil) {
            mlp->mobil = sp->shp_mobil;
        }
-       if (mlp->mobil < *minmobp)
-           *minmobp = mlp->mobil;
-       if (mlp->mobil > *maxmobp)
-           *maxmobp = mlp->mobil;
     }
 }
 
@@ -895,12 +887,6 @@ shp_nav_one_sector(struct emp_qelem *list, int dir, natid actor)
        }
        mlp->unit.ship.shp_mobil = (int)mlp->mobil;
        putship(mlp->unit.ship.shp_uid, &mlp->unit.ship);
-
-       /* Now update the map for this ship */
-       rad_map_set(mlp->unit.ship.shp_own,
-                   mlp->unit.ship.shp_x, mlp->unit.ship.shp_y,
-                   mlp->unit.ship.shp_effic, mlp->unit.ship.shp_tech,
-                   mchr[mlp->unit.ship.shp_type].m_vrnge);
     }
     if (QEMPTY(list))
        return stopping;
index 4ddff78e9a03f95bb4a9fc2af76332fb060bf088..baa5974ae78b68452af72e49762ec798faa81e4c 100644 (file)
  *
  *  Known contributors to this file:
  *     Ron Koenderink, 2007
- *     Markus Armbruster, 2009-2014
+ *     Markus Armbruster, 2009-2015
  */
 
 #include <config.h>
 
+#include <math.h>
 #include "file.h"
 #include "map.h"
 #include "optlist.h"
@@ -200,12 +201,18 @@ unit_view(struct emp_qelem *list)
     }
 }
 
-static void
-pr_leader_change(struct empobj *leader)
+void
+unit_rad_map_set(struct emp_qelem *list)
 {
-    pr("Changing %s to %s\n",
-       leader->ef_type == EF_SHIP ? "flagship" : "leader",
-       unit_nameof(leader));
+    struct emp_qelem *qp;
+    struct empobj *unit;
+
+    for (qp = list->q_back; qp != list; qp = qp->q_back) {
+       unit = &((struct ulist *)qp)->unit.gen;
+       rad_map_set(unit->own, unit->x, unit->y, unit->effic, unit->tech,
+                   unit->ef_type == EF_SHIP
+                   ? mchr[unit->type].m_vrnge : lchr[unit->type].l_spy);
+    }
 }
 
 static struct empobj *
@@ -215,8 +222,10 @@ get_leader(struct emp_qelem *list)
 }
 
 static void
-switch_leader(struct emp_qelem *list, int uid)
+switch_leader(struct emp_qelem *list, char *arg)
 {
+    int uid = arg ? atoi(arg) : -1;
+
     struct emp_qelem *qp, *save;
     struct ulist *ulp;
 
@@ -234,190 +243,222 @@ switch_leader(struct emp_qelem *list, int uid)
     } while (list->q_back != save);
 }
 
-int
-unit_move(struct emp_qelem *ulist, double *minmob, double *maxmob)
+static char *
+unit_move_parse(char *cp, char *arg1_default)
 {
-    char *cp = NULL;
-    int leader_uid;
-    struct empobj *leader;
-    int dir;
-    int stopping = 0;
-    int skip = 0;
-    int moved = 0;
-    char buf[1024];
-    char prompt[128];
-    char bmap_flag;
     int ac;
-    int type;
 
-    leader = get_leader(ulist);
-    leader_uid = leader->uid;
-    type = leader->ef_type;
+    ac = parse(cp, player->argbuf, player->argp, NULL, NULL, NULL);
+    if (CANT_HAPPEN(ac <= 0)) {
+       player->argp[0] = "";
+       return "";
+    }
+    if (ac == 1) {
+       player->argp[1] = arg1_default;
+       return cp + 1;
+    }
+    return "";
+}
+
+static char *
+unit_move_non_dir(struct emp_qelem *list, char *cp, int *map_shown)
+{
+    struct empobj *leader = get_leader(list);
+    int bmap = 0, stopping;
+    char leader_str[32];
+
+    *map_shown = 0;
+    sprintf(leader_str, "%d", leader->uid);
+
+    switch (*cp) {
+    case 'B':
+       bmap = 'b';
+       /* fall through */
+    case 'M':
+       cp = unit_move_parse(cp, leader_str);
+       display_region_map(bmap, leader->ef_type, leader->x, leader->y,
+                          player->argp[1], player->argp[2]);
+       *map_shown = 1;
+       break;
+    case 'f':
+       cp = unit_move_parse(cp, NULL);
+       switch_leader(list, player->argp[1]);
+       break;
+    case 'i':
+       cp++;
+       unit_list(list);
+       break;
+    case 'm':
+       cp++;
+       if (leader->ef_type == EF_SHIP)
+           stopping = shp_sweep(list, 1, 1, player->cnum);
+       else
+           stopping = lnd_sweep(list, 1, 1, player->cnum);
+       if (stopping)
+           cp = "";
+       break;
+    case 'r':
+       cp = unit_move_parse(cp, leader_str);
+       radar(leader->ef_type);
+       player->btused++;       /* FIXME use player_coms[].c_cost */
+       *map_shown = 1;
+       break;
+    case 'l':
+       cp = unit_move_parse(cp, leader_str);
+       do_look(leader->ef_type);
+       player->btused++;       /* FIXME likewise */
+       break;
+    case 's':
+       if (leader->ef_type != EF_SHIP)
+           return NULL;
+       cp = unit_move_parse(cp, leader_str);
+       sona();
+       player->btused++;       /* FIXME likewise */
+       *map_shown = 1;
+       break;
+    case 'd':
+       cp = unit_move_parse(cp, NULL);
+       if (!player->argp[1]) {
+           player->argp[1] = leader_str;
+           player->argp[2] = "1";
+       } else if (!player->argp[2]) {
+           player->argp[2] = player->argp[1];
+           player->argp[1] = leader_str;
+       }
+       if (leader->ef_type == EF_SHIP)
+           mine();
+       else
+           landmine();
+       player->btused++;       /* FIXME likewise */
+       *map_shown = 1;
+       break;
+    case 'v':
+       cp++;
+       unit_view(list);
+       break;
+    default:
+       return NULL;
+    }
+
+    return cp;
+}
+
+static char *
+unit_move_getpath(struct emp_qelem *list, int suppress_map, char *path)
+{
+    struct empobj *leader = get_leader(list);
+    double minmob, maxmob;
+    struct emp_qelem *qp;
+    struct ulist *ulp;
+    char prompt[64];
+
+    minmob = HUGE_VAL;
+    maxmob = -HUGE_VAL;
+    for (qp = list->q_back; qp != list; qp = qp->q_back) {
+       ulp = (struct ulist *)qp;
+       if (ulp->mobil < minmob)
+           minmob = ulp->mobil;
+       if (ulp->mobil > maxmob)
+           maxmob = ulp->mobil;
+    }
+    if (!suppress_map)
+       nav_map(leader->x, leader->y,
+               leader->ef_type == EF_SHIP
+               ? !(mchr[leader->type].m_flags & M_SUB) : 1);
+    snprintf(prompt, sizeof(prompt), "<%.1f:%.1f: %s> ",
+            maxmob, minmob,
+            xyas(leader->x, leader->y, player->cnum));
+    return getstring(prompt, path);
+}
+
+int
+unit_move(struct emp_qelem *list)
+{
+    struct empobj *leader = get_leader(list);
+    int leader_uid = leader->uid;
+    int type = leader->ef_type;
+    int moved, suppress_map, dir, stopping;
+    char *cp;
+    char path[1024];
+
+    unit_rad_map_set(list);
+
     pr("%s is %s\n",
        type == EF_SHIP ? "Flagship" : "Leader",
        unit_nameof(leader));
 
+    cp = "";
     if (player->argp[2]) {
-       strcpy(buf, player->argp[2]);
-       cp = unit_path(leader, buf, sizeof(buf));
+       strcpy(path, player->argp[2]);
+       cp = unit_path(leader, path, sizeof(path));
+       if (!cp)
+           cp = "";
     }
 
-    while (!QEMPTY(ulist)) {
-       char dp[80];
-
-       if (cp == NULL || *cp == '\0' || stopping) {
-           stopping = 0;
-           if (type == EF_SHIP)
-               shp_nav(ulist, minmob, maxmob, player->cnum);
-           else
-               lnd_mar(ulist, minmob, maxmob, player->cnum);
-           if (QEMPTY(ulist)) {
-               pr("No %s left\n", type == EF_SHIP ? "ships" : "lands");
-               return RET_OK;
-           }
-           leader = get_leader(ulist);
-           if (leader->uid != leader_uid) {
-               leader_uid = leader->uid;
-               pr_leader_change(leader);
-               stopping = 1;
-               continue;
-           }
-           if (!skip)
-               nav_map(leader->x, leader->y,
-                       type == EF_SHIP
-                       ? !(mchr[(int)leader->type].m_flags & M_SUB) : 1);
-           else
-               skip = 0;
-           sprintf(prompt, "<%.1f:%.1f: %s> ", *maxmob,
-                   *minmob, xyas(leader->x, leader->y, player->cnum));
-           cp = getstring(prompt, buf);
-           /* Just in case any of our units were shelled while we were
-            * at the prompt, we call shp_nav() or lnd_mar() again.
-            */
-           if (type == EF_SHIP)
-               shp_nav(ulist, minmob, maxmob, player->cnum);
-           else
-               lnd_mar(ulist, minmob, maxmob, player->cnum);
-           if (QEMPTY(ulist)) {
-               pr("No %s left\n", type == EF_SHIP ? "ships" : "lands");
-               return RET_OK;
-           }
-           leader = get_leader(ulist);
-           if (leader->uid != leader_uid) {
-               leader_uid = leader->uid;
-               pr_leader_change(leader);
-               stopping = 1;
-               continue;
-           }
-           if (cp)
-               cp = unit_path(leader, buf, sizeof(buf));
-       }
-       if (type == EF_SHIP) {
-           rad_map_set(player->cnum, leader->x, leader->y, leader->effic,
-                       leader->tech, mchr[leader->type].m_vrnge);
-       }
-       if (cp == NULL || *cp == '\0')
-           cp = &dirch[DIR_STOP];
-       dir = chkdir(*cp, DIR_STOP, DIR_LAST);
-       if (dir >= 0) {
+    moved = suppress_map = 0;
+    for (;;) {
+       /*
+        * Invariants:
+        * - shp_may_nav() true for all ships
+        * - lnd_may_mar() true for all land units
+        * - leader is up-to-date
+        * Implies all are in the same sector
+        */
+       if (!*cp) {
+           cp = unit_move_getpath(list, suppress_map, path);
+           if (!cp)
+               return RET_FAIL;
+           cp = unit_path(leader, path, sizeof(path));
+           if (!cp || !*cp)
+               cp = "h";
+           suppress_map = 0;
+       } else if ((dir = chkdir(*cp, DIR_STOP, DIR_LAST)) >= 0) {
+           cp++;
            if (type == EF_SHIP)
-               stopping |= shp_nav_one_sector(ulist, dir, player->cnum);
+               stopping = shp_nav_one_sector(list, dir, player->cnum);
            else {
-               if (!moved && !lnd_abandon_askyn(ulist))
+               if (!moved && !lnd_abandon_askyn(list))
                    return RET_FAIL;
-               stopping |= lnd_mar_one_sector(ulist, dir, player->cnum);
+               stopping = lnd_mar_one_sector(list, dir, player->cnum);
            }
+           if (dir == DIR_STOP)
+               return RET_OK;
            moved = 1;
-           cp++;
-           continue;
-       }
-       ac = parse(cp, player->argbuf, player->argp, NULL, NULL, NULL);
-       if (ac <= 0) {
-           player->argp[0] = "";
-           cp = NULL;
-       } else if (ac == 1) {
-           sprintf(dp, "%d", leader->uid);
-           player->argp[1] = dp;
-           cp++;
-       } else
-           cp = NULL;
-       bmap_flag = 0;
-       switch (*player->argp[0]) {
-       case 'B':
-           bmap_flag = 'b';
-           /*
-            * fall through
-            */
-       case 'M':
-           display_region_map(bmap_flag, type, leader->x, leader->y,
-                              player->argp[1], player->argp[2]);
-           skip = 1;
-           continue;
-       case 'f':
-           if (ac <= 1)
-               switch_leader(ulist, -1);
-           else
-               switch_leader(ulist, atoi(player->argp[1]));
-           leader = get_leader(ulist);
-           if (leader->uid != leader_uid) {
-               leader_uid = leader->uid;
-               pr_leader_change(leader);
-           }
-           continue;
-       case 'i':
-           unit_list(ulist);
-           continue;
-       case 'm':
-           if (type == EF_SHIP)
-               stopping |= shp_sweep(ulist, 1, 1, player->cnum);
-           else {
-               stopping |= lnd_sweep(ulist, 1, 1, player->cnum);
-           }
-           continue;
-       case 'r':
-           radar(leader->ef_type);
-           skip = 1;
-           player->btused++;
-           continue;
-       case 'l':
-           do_look(type);
-           player->btused++;
-           continue;
-       case 's':
-           if (leader->ef_type != EF_SHIP)
-               break;
-           sona();
-           player->btused++;
-           skip = 1;
-           continue;
-       case 'd':
-           if (ac < 3) {
-               player->argp[2] = ac < 2 ? "1" : player->argp[1];
-               sprintf(dp, "%d", leader->uid);
-               player->argp[1] = dp;
+           if (stopping)
+               cp = "";
+       } else {
+           cp = unit_move_non_dir(list, cp, &suppress_map);
+           if (!cp) {
+               direrr("`%c' to stop", ", `%c' to view", NULL);
+               pr(", `i' to list %s, `f' to change %s,\n",
+                  type == EF_SHIP ? "ships" : "units",
+                  type == EF_SHIP ? "flagship" : "leader");
+               pr("`r' to radar, %s`l' to look, `M' to map, `B' to bmap,\n",
+                  type == EF_SHIP ? "`s' to sonar, " : "");
+               pr("`d' to drop mines, and `m' to minesweep\n");
+               cp = "";
            }
-           if (type == EF_SHIP)
-               mine();
-           else
-               landmine();
-           stopping = 1;
-           skip = 1;
-           player->btused++;
-           continue;
-       case 'v':
-           unit_view(ulist);
-           continue;
        }
-       direrr("`%c' to stop", ", `%c' to view", NULL);
-       pr(", `i' to list %s, `f' to change %s,\n",
-           type == EF_SHIP ? "ships" : "units",
-           type == EF_SHIP ? "flagship" : "leader");
-       pr("`r' to radar, %s`l' to look, `M' to map, `B' to bmap,\n",
-           type == EF_SHIP ? "`s' to sonar, " : "");
-       pr("`d' to drop mines, and `m' to minesweep\n");
-       stopping = 1;
+
+       if (type == EF_SHIP)
+           shp_nav(list, player->cnum);
+       else
+           lnd_mar(list, player->cnum);
+
+       if (QEMPTY(list)) {
+           pr("No %s left\n", type == EF_SHIP ? "ships" : "lands");
+           return RET_OK;
+       }
+
+       leader = get_leader(list);
+       if (leader->uid != leader_uid) {
+           leader_uid = leader->uid;
+           pr("Changing %s to %s\n",
+              leader->ef_type == EF_SHIP ? "flagship" : "leader",
+              unit_nameof(leader));
+       }
+       unit_rad_map_set(list);
     }
-    return RET_OK;
 }
 
 /*
index a1da271958378e3cf36c4683480933033ae75f7a..8074492d50c1aebb5b6c480f55fa9f0703e1842f 100644 (file)
@@ -30,7 +30,6 @@ iyh
 | lose crew, by hitting mines in 11,-5
 | at least one hit must lose crew; use __cmd to force it if necessary
 navi 32/33/34/35/36/37/38/39 jiyh
-| BUG: moves on without crew
 | TODO sink ship at navi prompt, changing leader
 | TODO slap bridge onto ship at navi prompt
 || sector entry
@@ -126,5 +125,4 @@ navi 135/130/131/136/137/138/139
 j
 | implicit sweep, not all capable
 mmmh
-| BUG: mobility use low
 || TODO interdiction
index 97202094e4dedd9eca9ba098917b4fb97e39cefc..b0131478af093f76781b4af356329ec46aa4ff49 100644 (file)
@@ -29,7 +29,6 @@ iyh
 | at least one hit must lose crew; use __cmd to force it if necessary
 __cmd added -1 0 0
 march 32/33/34/35/36/37/38/39 jiyh
-| BUG: moves on without crew
 | TODO destroy land unit at march prompt, changing leader
 | TODO kidnap at march prompt
 || sector entry
@@ -97,7 +96,6 @@ l
 l 0
 gbbb
 B 0
-| BUG: radar not used on march
 M *
 r
 r 100
@@ -127,5 +125,4 @@ march 135/130/131/136/137/138/139
 j
 | implicit sweep, not all capable
 mmmh
-| BUG: mobility use low
 || TODO interdiction
index 1cee895da4583a30929cced3504daa883d4602fb..d8f02f0887d53f3e9a5eb3833df1717c039f3a9f 100644 (file)
@@ -145,14 +145,14 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil
 28 1 3 -1 9 100 117 0 40 4 0 none 0 "" 0 2 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 30 1 10 -6 9 100 108 0 40 9 -5 none 0 "" 0 2 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 31 0 11 -5 9 0 53 0 40 9 -5 none 0 "" 0 2 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
-32 1 10 -6 9 75 105 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
-33 1 10 -6 9 80 106 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
+32 1 10 -6 9 75 75 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
+33 1 10 -6 9 80 82 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 34 1 10 -6 9 100 108 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
-35 1 10 -6 9 66 103 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
-36 1 10 -6 9 80 106 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
-37 1 10 -6 9 80 106 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
-38 1 10 -6 9 69 104 0 40 9 -5 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
-39 1 10 -6 9 64 103 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
+35 1 10 -6 9 66 63 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
+36 1 10 -6 9 80 82 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
+37 1 10 -6 9 80 82 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
+38 1 11 -5 9 69 117 0 40 9 -5 none 0 "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
+39 1 10 -6 9 64 60 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 50 1 1 1 9 100 117 0 40 0 0 none 0 "" 0 2 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 51 1 4 0 9 100 127 0 40 4 0 none 0 "" 0 2 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 52 1 2 0 9 100 117 0 40 4 0 none 0 "" 0 2 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
@@ -189,8 +189,8 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius fleet civil
 122 1 13 -3 16 100 85 0 40 0 0 none 0 "" 0 5 3 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 128 1 11 -3 16 100 -12 0 40 0 0 none 0 "" 0 5 5 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 129 1 10 -2 16 100 99 0 40 0 0 none 0 "" 0 5 100 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
-130 1 11 -5 16 43 1 0 40 0 0 none 0 "" 0 3 10 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
-131 1 11 -5 16 58 20 0 40 0 0 none 0 "" 0 3 11 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
+130 1 11 -5 16 43 -11 0 40 0 0 none 0 "" 0 4 9 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
+131 1 11 -5 16 66 12 0 40 0 0 none 0 "" 0 3 14 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 135 1 11 -5 9 70 82 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 136 1 11 -5 9 69 81 0 40 9 -5 none 0 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
 137 1 11 -5 9 100 117 0 40 9 -5 none 0 "" 0 2 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 0 "" 1 1 1 () ""
@@ -222,14 +222,14 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship h
 25 1 -5 3 0 100 127 0 30 -5 3 reserve 3 "" -1 127 42 (bombed) "hhhhn" 0 5 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 30 1 7 5 0 100 93 0 30 6 6 none 3 "" -1 0 42 () "" 0 5 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 31 0 8 6 0 0 85 0 30 6 6 none 3 "" -1 0 42 () "" 0 4 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-32 1 7 5 0 87 93 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+32 1 7 5 0 87 78 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 33 1 7 5 0 100 93 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-34 1 7 5 0 86 93 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-35 1 7 5 0 87 93 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-36 1 7 5 0 78 93 0 30 6 6 none 3 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-37 1 7 5 0 90 93 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-38 1 7 5 0 78 93 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-39 1 7 5 0 84 93 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+34 1 7 5 0 86 78 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+35 1 7 5 0 87 79 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+36 1 8 6 0 78 104 0 30 6 6 none 3 "" -1 0 42 () "" 0 0 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+37 1 7 5 0 90 81 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+38 1 7 5 0 78 69 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+39 1 7 5 0 84 75 0 30 6 6 none 3 "" -1 0 42 () "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 50 1 11 3 0 100 105 0 30 9 3 none 3 "" -1 0 42 () "" 0 5 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 51 1 -1 3 0 100 105 0 30 1 3 none 3 "" -1 0 42 () "" 0 5 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 52 1 -3 3 0 100 127 0 30 -3 3 none 3 "" -1 127 42 () "" 0 5 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
@@ -265,7 +265,7 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius army ship h
 120 1 2 0 15 100 127 0 130 2 0 none 1 "" -1 127 42 () "" 0 5 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 121 1 7 7 15 100 52 0 130 7 7 none 1 "" -1 0 42 () "" 0 5 3 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 128 1 9 7 15 100 -23 0 130 7 7 none 1 "" -1 0 42 () "" 0 5 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
-130 1 8 6 15 94 52 0 130 6 6 none 1 "" -1 0 42 () "" 0 5 3 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
+130 1 8 6 15 94 48 0 130 6 6 none 1 "" -1 0 42 () "" 0 5 3 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 131 1 8 6 15 96 48 0 130 6 6 none 1 "" -1 0 42 () "" 0 5 3 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 135 1 8 6 0 100 104 0 30 6 6 none 3 "" -1 0 42 () "" 0 5 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
 136 1 8 6 0 100 104 0 30 6 6 none 3 "" -1 0 42 () "" 0 5 0 0 0 0 0 0 0 0 0 0 0 0 healthy 0 -1 0
@@ -279,7 +279,7 @@ uid owner xloc yloc type effic mobil off tech opx opy mission radius stockpile p
 /config
 config news
 actor action victim times duration time
-1 25 0 21 0 0
+1 25 0 20 0 0
 1 56 0 11 0 0
 /config
 config trade
index 96557690651fde98594c375d846e37d9edb8388e..f27417caf2cb6845ec30d078565432380a30da6c 100644 (file)
     Play#1 output Play#1 1     pt   patrol boat (#38) takes 31
     Play#1 output Play#1 1 Kawhomp! Mine detected in 11,-5!
     Play#1 output Play#1 1     pt   patrol boat (#39) takes 36
+    Play#1 output Play#1 1 pt   patrol boat (#38) is crewless & stays in 11,-5
     Play#1 output Play#1 1 shp#     ship type       x,y   fl  eff mil  sh gun pn he xl ln mob tech
     Play#1 output Play#1 1   32 pt   patrol boat   11,-5      75%   1   0   0  0  0  0  0  88  40
     Play#1 output Play#1 1   33 pt   patrol boat   11,-5      80%   1   0   0  0  0  0  0  94  40
     Play#1 output Play#1 1   35 pt   patrol boat   11,-5      66%   1   0   0  0  0  0  0  77  40
     Play#1 output Play#1 1   36 pt   patrol boat   11,-5      80%   1   0   0  0  0  0  0  94  40
     Play#1 output Play#1 1   37 pt   patrol boat   11,-5      80%   1   0   0  0  0  0  0  94  40
-    Play#1 output Play#1 1   38 pt   patrol boat   11,-5      69%   0   0   0  0  0  0  0  81  40
     Play#1 output Play#1 1   39 pt   patrol boat   11,-5      64%   1   0   0  0  0  0  0  75  40
     Play#1 output Play#1 1 pt   patrol boat (#32) stopped at 10,-6
     Play#1 output Play#1 1 pt   patrol boat (#33) stopped at 10,-6
     Play#1 output Play#1 1 pt   patrol boat (#35) stopped at 10,-6
     Play#1 output Play#1 1 pt   patrol boat (#36) stopped at 10,-6
     Play#1 output Play#1 1 pt   patrol boat (#37) stopped at 10,-6
-    Play#1 output Play#1 1 pt   patrol boat (#38) stopped at 10,-6
     Play#1 output Play#1 1 pt   patrol boat (#39) stopped at 10,-6
     Play#1 output Play#1 6 0 628
     Play#1 input navi 50 nh
     Play#1 output Play#1 4 <127.0:0.0: 0,0>
     Play#1 input yyyy
     Play#1 output Play#1 1 cs   cargo ship (#84) is out of mobility & stays in 0,0
+    Play#1 output Play#1 1 Changing flagship to cs   cargo ship (#83)
     Play#1 output Play#1 1 cs   cargo ship (#83) is out of mobility & stays in -1,-1
-    Play#1 output Play#1 1 cs   cargo ship (#82) is out of mobility & stays in -3,-3
     Play#1 output Play#1 1 Changing flagship to cs   cargo ship (#80)
+    Play#1 output Play#1 1 cs   cargo ship (#82) is out of mobility & stays in -3,-3
     Play#1 output Play#1 1  . .
     Play#1 output Play#1 1 . . .
     Play#1 output Play#1 1  . .
     Play#1 output Play#1 1   -5  . .     . . X .      -5
     Play#1 output Play#1 1   -4 . . .     . . .       -4
     Play#1 output Play#1 1   -3  . i                  -3
-    Play#1 output Play#1 1   -2 . . . .               -2
-    Play#1 output Play#1 1   -1  . i . . . .       .  -1
-    Play#1 output Play#1 1    0 . . = . = O =     . . 0
-    Play#1 output Play#1 1    1  h h h h h h       ?  1
-    Play#1 output Play#1 1    2 c c c c c           ? 2
+    Play#1 output Play#1 1   -2 . . . . . . .         -2
+    Play#1 output Play#1 1   -1  . i . . . . .     .  -1
+    Play#1 output Play#1 1    0 . . = . = O = .   . . 0
+    Play#1 output Play#1 1    1  h h h h h h ?     ?  1
+    Play#1 output Play#1 1    2 c c c c c c ?       ? 2
     Play#1 output Play#1 1    3    + +                3
     Play#1 output Play#1 1    4                       4
     Play#1 output Play#1 1    5                       5
     Play#1 output Play#1 1   -2      . . . . . . . .  -2
     Play#1 output Play#1 1   -1 . . . . . i . . . . . -1
     Play#1 output Play#1 1    0  . = . . . = . = . =  0
-    Play#1 output Play#1 1    1 h h h h h P h h h h   1
-    Play#1 output Play#1 1    2  c ? c c c c c c      2
+    Play#1 output Play#1 1    1 h h h h h P h h h h ? 1
+    Play#1 output Play#1 1    2  c ? c c c c c c c ?  2
     Play#1 output Play#1 1    3           + +         3
     Play#1 output Play#1 1    4                       4
     Play#1 output Play#1 1    5                       5
     Play#1 output Play#1 1 Kawhomp! Mine detected in 11,-5!
     Play#1 output Play#1 1     ms   minesweeper (#130) takes 10
     Play#1 output Play#1 1 Sweep...
-    Play#1 output Play#1 1 Kawhomp! Mine detected in 11,-5!
-    Play#1 output Play#1 1     ms   minesweeper (#131) takes 11
+    Play#1 output Play#1 1 Sweep...
     Play#1 output Play#1 1 pt   patrol boat (#135) stopped at 11,-5
     Play#1 output Play#1 1 ms   minesweeper (#130) stopped at 11,-5
     Play#1 output Play#1 1 ms   minesweeper (#131) stopped at 11,-5
     Play#1 output Play#1 1     cav  cavalry #38 takes 22
     Play#1 output Play#1 1 Blammo! Landmines detected in 8,6!
     Play#1 output Play#1 1     cav  cavalry #39 takes 16
+    Play#1 output Play#1 1 cav  cavalry #36 has no mil on it to guide it & stays in 8,6
     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   32 cav  cavalry        8,6       87%   1   0   0  0  0  90  30  42%
     Play#1 output Play#1 1   33 cav  cavalry        8,6      100%   1   0   0  0  0 104  30  42%
     Play#1 output Play#1 1   34 cav  cavalry        8,6       86%   1   0   0  0  0  90  30  42%
     Play#1 output Play#1 1   35 cav  cavalry        8,6       87%   1   0   0  0  0  91  30  42%
-    Play#1 output Play#1 1   36 cav  cavalry        8,6       78%   0   0   0  0  0  82  30  42%
     Play#1 output Play#1 1   37 cav  cavalry        8,6       90%   1   0   0  0  0  93  30  42%
     Play#1 output Play#1 1   38 cav  cavalry        8,6       78%   1   0   0  0  0  81  30  42%
     Play#1 output Play#1 1   39 cav  cavalry        8,6       84%   1   0   0  0  0  87  30  42%
     Play#1 output Play#1 1 cav  cavalry #33 stopped at 7,5
     Play#1 output Play#1 1 cav  cavalry #34 stopped at 7,5
     Play#1 output Play#1 1 cav  cavalry #35 stopped at 7,5
-    Play#1 output Play#1 1 cav  cavalry #36 stopped at 7,5
     Play#1 output Play#1 1 cav  cavalry #37 stopped at 7,5
     Play#1 output Play#1 1 cav  cavalry #38 stopped at 7,5
     Play#1 output Play#1 1 cav  cavalry #39 stopped at 7,5
     Play#1 output Play#1 4 <127.0:0.0: 3,5>
     Play#1 input jjun
     Play#1 output Play#1 1 cav  cavalry #84 is out of mobility & stays in 3,5
+    Play#1 output Play#1 1 Changing leader to cav  cavalry #83
     Play#1 output Play#1 1 cav  cavalry #83 is out of mobility & stays in 5,5
-    Play#1 output Play#1 1 cav  cavalry #82 is out of mobility & stays in 8,4
     Play#1 output Play#1 1 Changing leader to cav  cavalry #80
+    Play#1 output Play#1 1 cav  cavalry #82 is out of mobility & stays in 8,4
     Play#1 output Play#1 1  m m
     Play#1 output Play#1 1 m m m
     Play#1 output Play#1 1  m m
     Play#1 output Play#1 1    0  . = . . . = . = . =  0
     Play#1 output Play#1 1    1 h h h h h C h h h h ? 1
     Play#1 output Play#1 1    2  c c c c c c c c c ?  2
-    Play#1 output Play#1 1    3   + + + + + + + + + ? 3
+    Play#1 output Play#1 1    3   + + + + + + + + + + 3
     Play#1 output Play#1 1    4    m m m m + m m m m  4
     Play#1 output Play#1 1    5     m m m m + m m m m 5
     Play#1 output Play#1 1    6    ? ? ? m m m m m m  6
     Play#1 output Play#1 1    0  . = . . . = . = . =  0
     Play#1 output Play#1 1    1 h h h h h C h h h h ? 1
     Play#1 output Play#1 1    2  c c c c c c c c c ?  2
-    Play#1 output Play#1 1    3   + + + + + + + + + ? 3
-    Play#1 output Play#1 1    4    m m m m + m m m m  4
-    Play#1 output Play#1 1    5     m m m m + m m m m 5
+    Play#1 output Play#1 1    3   + + + + + + + + + + 3
+    Play#1 output Play#1 1    4  ? m m m m + m m m m  4
+    Play#1 output Play#1 1    5   ? m m m m + m m m m 5
     Play#1 output Play#1 1    6    ? ? ? m m m m m m  6
     Play#1 output Play#1 1      ---------000000000011
     Play#1 output Play#1 1      987654321012345678901
     Play#0 output Play#0 1   1   27 pt   patrol boat    1,-1      100%   0   2   0   0  0  0  0  0 127   40
     Play#0 output Play#0 1   1   28 pt   patrol boat    3,-1      100%   0   2   0   0  0  0  0  0 117   40
     Play#0 output Play#0 1   1   30 pt   patrol boat   10,-6      100%   0   2   0   0  0  0  0  0 108   40
-    Play#0 output Play#0 1   1   32 pt   patrol boat   10,-6       75%   0   1   0   0  0  0  0  0 105   40
-    Play#0 output Play#0 1   1   33 pt   patrol boat   10,-6       80%   0   1   0   0  0  0  0  0 106   40
+    Play#0 output Play#0 1   1   32 pt   patrol boat   10,-6       75%   0   1   0   0  0  0  0  0  75   40
+    Play#0 output Play#0 1   1   33 pt   patrol boat   10,-6       80%   0   1   0   0  0  0  0  0  82   40
     Play#0 output Play#0 1   1   34 pt   patrol boat   10,-6      100%   0   1   0   0  0  0  0  0 108   40
-    Play#0 output Play#0 1   1   35 pt   patrol boat   10,-6       66%   0   1   0   0  0  0  0  0 103   40
-    Play#0 output Play#0 1   1   36 pt   patrol boat   10,-6       80%   0   1   0   0  0  0  0  0 106   40
-    Play#0 output Play#0 1   1   37 pt   patrol boat   10,-6       80%   0   1   0   0  0  0  0  0 106   40
-    Play#0 output Play#0 1   1   38 pt   patrol boat   10,-6       69%   0   0   0   0  0  0  0  0 104   40
-    Play#0 output Play#0 1   1   39 pt   patrol boat   10,-6       64%   0   1   0   0  0  0  0  0 103   40
+    Play#0 output Play#0 1   1   35 pt   patrol boat   10,-6       66%   0   1   0   0  0  0  0  0  63   40
+    Play#0 output Play#0 1   1   36 pt   patrol boat   10,-6       80%   0   1   0   0  0  0  0  0  82   40
+    Play#0 output Play#0 1   1   37 pt   patrol boat   10,-6       80%   0   1   0   0  0  0  0  0  82   40
+    Play#0 output Play#0 1   1   38 pt   patrol boat   11,-5       69%   0   0   0   0  0  0  0  0 117   40
+    Play#0 output Play#0 1   1   39 pt   patrol boat   10,-6       64%   0   1   0   0  0  0  0  0  60   40
     Play#0 output Play#0 1   1   50 pt   patrol boat    1,1       100%   0   2   0   0  0  0  0  0 117   40
     Play#0 output Play#0 1   1   51 pt   patrol boat    4,0       100%   0   2   0   0  0  0  0  0 127   40
     Play#0 output Play#0 1   1   52 pt   patrol boat    2,0       100%   0   2   0   0  0  0  0  0 117   40
     Play#0 output Play#0 1   1  122 ms   minesweeper   13,-3      100%   0   5   0   0  0  0  0  0  85   40
     Play#0 output Play#0 1   1  128 ms   minesweeper   11,-3      100%   0   5   0   0  0  0  0  0 -12   40
     Play#0 output Play#0 1   1  129 ms   minesweeper   10,-2      100%   0   5   0   0  0  0  0  0  99   40
-    Play#0 output Play#0 1   1  130 ms   minesweeper   11,-5       43%   0   3   0   0  0  0  0  0   1   40
-    Play#0 output Play#0 1   1  131 ms   minesweeper   11,-5       58%   0   3   0   0  0  0  0  0  20   40
+    Play#0 output Play#0 1   1  130 ms   minesweeper   11,-5       43%   0   4   0   0  0  0  0  0 -11   40
+    Play#0 output Play#0 1   1  131 ms   minesweeper   11,-5       66%   0   3   0   0  0  0  0  0  12   40
     Play#0 output Play#0 1   1  135 pt   patrol boat   11,-5       70%   0   1   0   0  0  0  0  0  82   40
     Play#0 output Play#0 1   1  136 pt   patrol boat   11,-5       69%   0   1   0   0  0  0  0  0  81   40
     Play#0 output Play#0 1   1  137 pt   patrol boat   11,-5      100%   0   2   0   0  0  0  0  0 117   40
     Play#0 output Play#0 1  122 ms     13,-3     100%   0   5   0   3   0   0   0   0   0   0   0   0   0
     Play#0 output Play#0 1  128 ms     11,-3     100%   0   5   0   5   0   0   0   0   0   0   0   0   0
     Play#0 output Play#0 1  129 ms     10,-2     100%   0   5   0 100   0   0   0   0   0   0   0   0   0
-    Play#0 output Play#0 1  130 ms     11,-5      43%   0   3   0  10   0   0   0   0   0   0   0   0   0
-    Play#0 output Play#0 1  131 ms     11,-5      58%   0   3   0  11   0   0   0   0   0   0   0   0   0
+    Play#0 output Play#0 1  130 ms     11,-5      43%   0   4   0   9   0   0   0   0   0   0   0   0   0
+    Play#0 output Play#0 1  131 ms     11,-5      66%   0   3   0  14   0   0   0   0   0   0   0   0   0
     Play#0 output Play#0 1 8 ships
     Play#0 output Play#0 6 0 640
     Play#0 input retr * ?rflags#0
     Play#0 output Play#0 1   1   24 tra  train         2,2       100%   5 127 127   0  40  42%  0  0
     Play#0 output Play#0 1   1   25 cav  cavalry      -5,3       100%   5 127 127   0  30  42%  0  0
     Play#0 output Play#0 1   1   30 cav  cavalry       7,5       100%   5   0  93   0  30  42%  0  0
-    Play#0 output Play#0 1   1   32 cav  cavalry       7,5        87%   1   0  93   0  30  42%  0  0
+    Play#0 output Play#0 1   1   32 cav  cavalry       7,5        87%   1   0  78   0  30  42%  0  0
     Play#0 output Play#0 1   1   33 cav  cavalry       7,5       100%   1   0  93   0  30  42%  0  0
-    Play#0 output Play#0 1   1   34 cav  cavalry       7,5        86%   1   0  93   0  30  42%  0  0
-    Play#0 output Play#0 1   1   35 cav  cavalry       7,5        87%   1   0  93   0  30  42%  0  0
-    Play#0 output Play#0 1   1   36 cav  cavalry       7,5        78%   0   0  93   0  30  42%  0  0
-    Play#0 output Play#0 1   1   37 cav  cavalry       7,5        90%   1   0  93   0  30  42%  0  0
-    Play#0 output Play#0 1   1   38 cav  cavalry       7,5        78%   1   0  93   0  30  42%  0  0
-    Play#0 output Play#0 1   1   39 cav  cavalry       7,5        84%   1   0  93   0  30  42%  0  0
+    Play#0 output Play#0 1   1   34 cav  cavalry       7,5        86%   1   0  78   0  30  42%  0  0
+    Play#0 output Play#0 1   1   35 cav  cavalry       7,5        87%   1   0  79   0  30  42%  0  0
+    Play#0 output Play#0 1   1   36 cav  cavalry       8,6        78%   0   0 104   0  30  42%  0  0
+    Play#0 output Play#0 1   1   37 cav  cavalry       7,5        90%   1   0  81   0  30  42%  0  0
+    Play#0 output Play#0 1   1   38 cav  cavalry       7,5        78%   1   0  69   0  30  42%  0  0
+    Play#0 output Play#0 1   1   39 cav  cavalry       7,5        84%   1   0  75   0  30  42%  0  0
     Play#0 output Play#0 1   1   50 cav  cavalry      11,3       100%   5   0 105   0  30  42%  0  0
     Play#0 output Play#0 1   1   51 cav  cavalry      -1,3       100%   5   0 105   0  30  42%  0  0
     Play#0 output Play#0 1   1   52 cav  cavalry      -3,3       100%   5 127 127   0  30  42%  0  0
     Play#0 output Play#0 1   1  120 eng  engineer      2,0       100%   5 127 127   0 130  42%  0  0
     Play#0 output Play#0 1   1  121 eng  engineer      7,7       100%   5   0  52   0 130  42%  0  0
     Play#0 output Play#0 1   1  128 eng  engineer      9,7       100%   5   0 -23   0 130  42%  0  0
-    Play#0 output Play#0 1   1  130 eng  engineer      8,6        94%   5   0  52   0 130  42%  0  0
+    Play#0 output Play#0 1   1  130 eng  engineer      8,6        94%   5   0  48   0 130  42%  0  0
     Play#0 output Play#0 1   1  131 eng  engineer      8,6        96%   5   0  48   0 130  42%  0  0
     Play#0 output Play#0 1   1  135 cav  cavalry       8,6       100%   5   0 104   0  30  42%  0  0
     Play#0 output Play#0 1   1  136 cav  cavalry       8,6       100%   5   0 104   0  30  42%  0  0
index 5484b00c9ad4a19d43974e2f8a19b7f32cbbb8ab..19553528b4127eeb9e23c100d3abe7d1f7fca7eb 100644 (file)
     Play#1 output Play#1 1   -4         - . . . . . . . . . . . . .       -4
     Play#1 output Play#1 1   -3          - . . . o . . . . . . . . .      -3
     Play#1 output Play#1 1   -2         . . o o c + t l . . o ? . ? .     -2
-    Play#1 output Play#1 1   -1          - . . b m j h = = ) o ? ? ? .    -1
+    Play#1 output Play#1 1   -1          - . . b m m h = = ) o ? ? ? .    -1
     Play#1 output Play#1 1    0         - - . j m m k . . . . ? ? ? ?     0
     Play#1 output Play#1 1    1          - - . k m m j d . . . ? ? ?      1
     Play#1 output Play#1 1    2         - - . i m k r w e ! . . ? ?       2