+ if (!player->owner || unit.gen.own == 0)
+ continue;
+ if (type == EF_SHIP) {
+ strncpy(unit.ship.shp_rpath, pq, RET_LEN - 1);
+ unit.ship.shp_rflags = rflags;
+ } else {
+ strncpy(unit.land.lnd_rpath, pq, RET_LEN - 1);
+ unit.land.lnd_rflags = rflags;
+ }
+ put_empobj(type, unit.gen.uid, &unit);
+ nunits++;
+ }
+ if (rflags) {
+ symbol_set_fmt(buf2, sizeof(buf2), rflags & ~RET_GROUP,
+ retreat_flags, ", ", 0);
+ pr("%d %s%s ordered to retreat%s along path %s when %s\n",
+ nunits, ef_nameof_pretty(type), splur(nunits),
+ rflags & RET_GROUP ? " as group" : "", pq, buf2);
+ } else
+ pr("%d %s%s ordered not to retreat\n",
+ nunits, ef_nameof_pretty(type), splur(nunits));
+ return RET_OK;
+}
+
+static int
+retreat_show(int type, struct nstr_item *np)
+{
+ char *rflagsc = type == EF_SHIP ? shp_rflagsc : lnd_rflagsc;
+ union empobj_storage unit;
+ int nunits;
+ char *name, *rpath, *what;
+ int *rflagsp, rflags, i;
+
+ nunits = 0;
+ while (nxtitem(np, &unit)) {