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
|
@ -460,7 +460,7 @@ extern int lnd_prewrite(int, void *);
|
|||
/* landgun.c */
|
||||
extern double seagun(int, int);
|
||||
extern double fortgun(int, int);
|
||||
extern double landunitgun(int, int, int, int, int);
|
||||
extern double landunitgun(int, int);
|
||||
extern double effrange(int, double);
|
||||
extern double torprange(struct shpstr *);
|
||||
extern double fortrange(struct sctstr *);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue