Factor out common land unit fire code into lnd_fire()
This takes care of a number of bugs / inconsistencies: * Resupply before fire: fire command did not require unit to be in supply, and resupplied shells. Everywhere else (return fire, support and interdiction) the land unit had to be in supply after resupply of everything. Unify not to resupply anything and not to require being in supply. This is consistent with ships and sectors. * Resupply after fire: fire command resupplied shells after active fire. Unify not to do that. This is consistent with ships and sectors. * When a land unit returned fire to multiple attackers, quiet_bigdef() charged it ammo for each one. Finally, it was charged one shell more by use_ammo(). Except only the first land unit got charged there in fact, because buggy add_to_fired_queue() entered only the first land unit into the defender list. Fix add_to_fired_queue() and change quiet_bigdef() not to charge ammo, just like for ships and sectors. This charges only one shell instead of the true ammo use, which is wrong, but consistent with ships. * lnd_support() tallied support damage unrounded. Unify to round before tally.
This commit is contained in:
parent
652afa12de
commit
f6c87d21ff
6 changed files with 92 additions and 124 deletions
|
@ -167,6 +167,8 @@ extern int l_acc(struct lchrstr *, int);
|
|||
extern int l_dam(struct lchrstr *, int);
|
||||
extern int l_aaf(struct lchrstr *, int);
|
||||
|
||||
extern int lnd_fire(struct lndstr *);
|
||||
|
||||
/* src/lib/subs/lndsub.c */
|
||||
extern void lnd_sweep(struct emp_qelem *, int, int, natid);
|
||||
extern int lnd_interdict(struct emp_qelem *, coord, coord, natid);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue