(deli, do_demo, lnd_sweep, guerrilla): Saturate items at ITEM_MAX.
With variables, item increases beyond the capacity of variables (65535) were ignored here. This should cover all item changes not going through putvec().
This commit is contained in:
parent
95ef2b139d
commit
58e93c0ea3
4 changed files with 10 additions and 4 deletions
|
@ -105,6 +105,8 @@ do_demo(struct natstr *natp, struct nstr_sect nstr, int number, s_char *p,
|
|||
continue;
|
||||
} else if ((deltamil = min(mil, number)) <= 0)
|
||||
continue;
|
||||
if (deltamil > ITEM_MAX - civ)
|
||||
deltamil = ITEM_MAX - civ;
|
||||
civ += deltamil;
|
||||
mil -= deltamil;
|
||||
mil_demob += deltamil;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue