(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.
This commit is contained in:
Markus Armbruster 2004-09-17 13:06:08 +00:00
parent 67480d040d
commit e8a089fe14

View file

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