]> git.pond.sub.org Git - empserver/commitdiff
(explore): Clear start sector's MOVE_IN_PROGRESS after updating end
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 16 May 2004 11:23:43 +0000 (11:23 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 16 May 2004 11:23:43 +0000 (11:23 +0000)
sector.  Otherwise, clearing MOVE_IN_PROGRESS can abandon the start
sector when it shouldn't, leading to bogus records in the `lost' file.
Closes #931184.

src/lib/commands/expl.c

index ed9690868fab09209a2b63767f2db0ffe942c1f1..40c332c70ffb29512498376c5a72a810a8b95528 100644 (file)
@@ -71,8 +71,7 @@ explore(void)
     s_char buf[1024];
     s_char prompt[128];
 
-    if ((ip =
-        whatitem(player->argp[1], "explore with what? (civ/mil) ")) == 0)
+    if (!(ip = whatitem(player->argp[1], "explore with what? (civ/mil) ")))
        return RET_SYN;
     vtype = ip->i_vtype;
     if ((vtype != V_CIVIL) && (vtype != V_MILIT)) {
@@ -232,9 +231,6 @@ explore(void)
            return RET_FAIL;
        }
     }
-    getsect(start.sct_x, start.sct_y, &start);
-    start.sct_flags &= ~MOVE_IN_PROGRESS;
-    putsect(&start);
     amt_dst = sect.sct_item[vtype];
     if (amount > ITEM_MAX - amt_dst) {
        amount = ITEM_MAX - amt_dst;
@@ -267,6 +263,9 @@ explore(void)
            = (amt_dst * sect.sct_work + amount * work) / (amt_dst + amount);
     }
     putsect(&sect);
+    getsect(start.sct_x, start.sct_y, &start);
+    start.sct_flags &= ~MOVE_IN_PROGRESS;
+    putsect(&start);
     return RET_OK;
 }