From e8a089fe149f3b750fc66b2e38b288be5e10a0d6 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 17 Sep 2004 13:06:08 +0000 Subject: [PATCH] (load_it): Loaded negative amount if ship had more cargo than ordered. 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/update/nav_util.c b/src/lib/update/nav_util.c index 4842468f..f193cb09 100644 --- a/src/lib/update/nav_util.c +++ b/src/lib/update/nav_util.c @@ -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 */