]> git.pond.sub.org Git - empserver/commitdiff
(marc, navi, retreat_ship1, retreat_land1): Treat any negative value
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 25 Sep 2005 10:00:43 +0000 (10:00 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 25 Sep 2005 10:00:43 +0000 (10:00 +0000)
of chkdir() as failure, not just -1.

src/lib/commands/marc.c
src/lib/commands/navi.c
src/lib/subs/retreat.c

index 65544902b3375c421027e3ff3ace605bfc78cbde..e5374297da820beeaff871b2dfe028ae5718424a 100644 (file)
@@ -160,7 +160,7 @@ march(void)
            continue;
        } else {
            dir = chkdir(*cp++, DIR_STOP, DIR_LAST);
-           if (dir == -1) {
+           if (dir < 0) {
                if (NULL != (cp = lnd_path(together, lnd, buf)))
                    continue;
                direrr("`%c' to stop", 0, 0);
index 61adf5e3a489d3928747a5a0fe42b72d9fbafcd8..2e4b3cce701c5e4bc5e2290f86fdb138cee0d718 100644 (file)
@@ -185,7 +185,7 @@ navi(void)
            continue;
        } else {
            dir = chkdir(*cp++, DIR_STOP, DIR_VIEW);
-           if (dir == -1) {
+           if (dir < 0) {
                if (NULL != (cp = shp_path(together, shp, buf)))
                    continue;
                direrr("`%c' to stop", ", `%c' to view, ", 0);
index f8f3f6bbec86284bc4cc0c0cd14f11374ad0f918..5a17ae9290c94a91a8591e0c1b64bd22eeca7f7a 100644 (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);
        memmove(sp->shp_rpath, sp->shp_rpath+1, sizeof(sp->shp_rpath) - 1);
-       if (dir == -1)
+       if (dir < 0)
            continue;
        if (dir == DIR_STOP)
            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);
        memmove(lp->lnd_rpath, lp->lnd_rpath+1, sizeof(lp->lnd_rpath) - 1);
-       if (dir == -1)
+       if (dir < 0)
            continue;
        if (dir == DIR_STOP)
            stopping++;