X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=src%2Flib%2Fsubs%2Fretreat.c;h=d850aa0c1b7eede4fc7e9ec87d1c180f6c031075;hp=97e982aa04ce1b56aa8ffeb25addd9dc419c250b;hb=40ec33b;hpb=1e3b7773d4e53cd94349c20c6145eafb1c4bb0cb diff --git a/src/lib/subs/retreat.c b/src/lib/subs/retreat.c index 97e982aa0..d850aa0c1 100644 --- a/src/lib/subs/retreat.c +++ b/src/lib/subs/retreat.c @@ -202,9 +202,7 @@ retreat_ship1(struct shpstr *sp, char code, int orig) } dir = chkdir(sp->shp_rpath[0], DIR_STOP, DIR_LAST); memmove(sp->shp_rpath, sp->shp_rpath+1, sizeof(sp->shp_rpath) - 1); - if (dir < 0) - continue; - if (dir == DIR_STOP) + if (dir == DIR_STOP || CANT_HAPPEN(dir < 0)) break; dx = diroff[dir][0]; dy = diroff[dir][1]; @@ -386,9 +384,7 @@ retreat_land1(struct lndstr *lp, char code, int orig) } dir = chkdir(lp->lnd_rpath[0], DIR_STOP, DIR_LAST); memmove(lp->lnd_rpath, lp->lnd_rpath+1, sizeof(lp->lnd_rpath) - 1); - if (dir < 0) - continue; - if (dir == DIR_STOP) + if (dir == DIR_STOP || CANT_HAPPEN(dir < 0)) break; dx = diroff[dir][0]; dy = diroff[dir][1];