]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/retreat.c
(lnd_mobtype): New.
[empserver] / src / lib / subs / retreat.c
index ea9ecce93e424e91d9011044548f36effa688030..cbfdecc139b311c0650fa9a30852c3f6674baa28 100644 (file)
@@ -312,8 +312,8 @@ retreat_ship1(struct shpstr *sp, char code, int orig)
     }
 
     if (orig) {
-       wu(0, sp->shp_own, "%s %s, and retreated to %s\n", prship(sp),
-          conditions[findcondition(code)].desc[orig],
+       wu(0, sp->shp_own, "%s %s, and retreated to %s\n",
+          prship(sp), conditions[findcondition(code)].desc[orig],
           xyas(sp->shp_x, sp->shp_y, sp->shp_own));
     } else {
        wu(0, sp->shp_own, "%s %s, and ended up at %s\n",
@@ -458,11 +458,10 @@ retreat_land1(struct lndstr *lp, char code, int orig)
        newy = ynorm(lp->lnd_y + dy);
 
        getsect(newx, newy, &sect);
-       if ((sect.sct_type == SCT_WATER) ||
-           (sect.sct_type == SCT_MOUNT) ||
-           (sect.sct_type == SCT_SANCT) ||
-           (sect.sct_type == SCT_WASTE) ||
-           (sect.sct_own != lp->lnd_own)) {
+       mobcost = lnd_mobcost(lp, &sect);
+       if (mobcost < 0
+           || sect.sct_type == SCT_MOUNT
+           || sect.sct_own != lp->lnd_own) {
            wu(0, lp->lnd_own, "%s %s,\nbut could not retreat to %s!\n",
               prland(lp),
               conditions[findcondition(code)].desc[orig],
@@ -471,7 +470,6 @@ retreat_land1(struct lndstr *lp, char code, int orig)
                putland(lp->lnd_uid, lp);
            return 0;
        }
-       mobcost = lnd_mobcost(lp, &sect, MOB_ROAD);
        lp->lnd_x = newx;
        lp->lnd_y = newy;
        lp->lnd_mobil -= mobcost;