(marc, navi, retreat_ship1, retreat_land1): Treat any negative value

of chkdir() as failure, not just -1.
This commit is contained in:
Markus Armbruster 2005-09-25 10:00:43 +00:00
parent dfa56cb0ef
commit 1fe759dc1e
3 changed files with 4 additions and 4 deletions

View file

@ -160,7 +160,7 @@ march(void)
continue; continue;
} else { } else {
dir = chkdir(*cp++, DIR_STOP, DIR_LAST); dir = chkdir(*cp++, DIR_STOP, DIR_LAST);
if (dir == -1) { if (dir < 0) {
if (NULL != (cp = lnd_path(together, lnd, buf))) if (NULL != (cp = lnd_path(together, lnd, buf)))
continue; continue;
direrr("`%c' to stop", 0, 0); direrr("`%c' to stop", 0, 0);

View file

@ -185,7 +185,7 @@ navi(void)
continue; continue;
} else { } else {
dir = chkdir(*cp++, DIR_STOP, DIR_VIEW); dir = chkdir(*cp++, DIR_STOP, DIR_VIEW);
if (dir == -1) { if (dir < 0) {
if (NULL != (cp = shp_path(together, shp, buf))) if (NULL != (cp = shp_path(together, shp, buf)))
continue; continue;
direrr("`%c' to stop", ", `%c' to view, ", 0); direrr("`%c' to stop", ", `%c' to view, ", 0);

View file

@ -243,7 +243,7 @@ retreat_ship1(struct shpstr *sp, s_char code, int orig)
} }
dir = chkdir(sp->shp_rpath[0], DIR_STOP, DIR_VIEW); dir = chkdir(sp->shp_rpath[0], DIR_STOP, DIR_VIEW);
memmove(sp->shp_rpath, sp->shp_rpath+1, sizeof(sp->shp_rpath) - 1); memmove(sp->shp_rpath, sp->shp_rpath+1, sizeof(sp->shp_rpath) - 1);
if (dir == -1) if (dir < 0)
continue; continue;
if (dir == DIR_STOP) if (dir == DIR_STOP)
stopping++; stopping++;
@ -469,7 +469,7 @@ retreat_land1(struct lndstr *lp, s_char code, int orig)
} }
dir = chkdir(lp->lnd_rpath[0], DIR_STOP, DIR_VIEW); dir = chkdir(lp->lnd_rpath[0], DIR_STOP, DIR_VIEW);
memmove(lp->lnd_rpath, lp->lnd_rpath+1, sizeof(lp->lnd_rpath) - 1); memmove(lp->lnd_rpath, lp->lnd_rpath+1, sizeof(lp->lnd_rpath) - 1);
if (dir == -1) if (dir < 0)
continue; continue;
if (dir == DIR_STOP) if (dir == DIR_STOP)
stopping++; stopping++;