]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/move.c
move_ground: Fix getsect() error checking
[empserver] / src / lib / subs / move.c
index a66d2840cbbe85f6509697337926793f124fe77e..95ac4e820789481702e2fe564047832860e192a0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2015, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -35,7 +35,6 @@
 #include <ctype.h>
 #include "chance.h"
 #include "damage.h"
-#include "file.h"
 #include "map.h"
 #include "nsc.h"
 #include "path.h"
@@ -112,7 +111,7 @@ move_ground(struct sctstr *start, struct sctstr *end,
     curx = start->sct_x;
     cury = start->sct_y;
     total_mcost = 0.0;
-    if (getsect(curx, cury, &sect) < 0) {
+    if (!getsect(curx, cury, &sect)) {
        logerror("move_path: getsect %d,%d", curx, cury);
        return -1;
     }
@@ -192,7 +191,7 @@ move_ground(struct sctstr *start, struct sctstr *end,
         */
        tmpx = curx + diroff[dir][0];
        tmpy = cury + diroff[dir][1];
-       if (getsect(tmpx, tmpy, &next) < 0) {
+       if (!getsect(tmpx, tmpy, &next)) {
            pr("You can't go there...\n");
            *movstr = 0;
            continue;