(buy, move, prod, dodistribute, produce): Obey ITEM_MAX. Previous

change to move() was incomplete.
This commit is contained in:
Markus Armbruster 2004-03-16 18:56:14 +00:00
parent 913774e53e
commit 9b7a65b865
5 changed files with 16 additions and 18 deletions

View file

@ -178,8 +178,8 @@ dodistribute(struct sctstr *sp, int imex, s_char *path, double dist_i_cost,
amt = amt_sect;
if (sp->sct_mobil < excost * amt)
amt = sp->sct_mobil / excost;
if (amt + amt_dist > 9999)
amt = 9999 - amt_dist;
if (amt > ITEM_MAX - amt_dist)
amt = ITEM_MAX - amt_dist;
if (amt == 0)
continue;
/* XXX replace with vector assign and putvec() */