]> git.pond.sub.org Git - empserver/commitdiff
(load_it): Loaded negative amount if ship had more cargo than ordered.
authorMarkus Armbruster <armbru@pond.sub.org>
Fri, 17 Sep 2004 13:06:08 +0000 (13:06 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 17 Sep 2004 13:06:08 +0000 (13:06 +0000)
This can happen when unload_it() can't unload, e.g. because sector is
full.  This can push the sector's amount beyond ITEM_MAX, and can even
overflow to negative amounts.

src/lib/update/nav_util.c

index 4842468ff45267aa78a1d6d1d799c74122cfff0e..f193cb0953189660ad99ece59bdb08ebad21a879 100644 (file)
@@ -129,7 +129,7 @@ load_it(struct shpstr *sp, struct sctstr *psect, int i)
        transfer = abs_max - ship_amt;  /* then the max alowed */
     /* on the ship.        */
 
-    if (transfer == 0)
+    if (transfer <= 0)
        return 0;               /* nothing to move */