]> git.pond.sub.org Git - empserver/commit
Factor out common land unit fire code into lnd_fire()
authorMarkus Armbruster <armbru@pond.sub.org>
Mon, 3 Mar 2008 07:29:52 +0000 (08:29 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Fri, 14 Mar 2008 19:25:38 +0000 (20:25 +0100)
commitf6c87d21fff9b94c0a4691fb46d1d0765112b908
treee6eeecef80e34585e4c970c6a1ac76869e8e2a04
parent652afa12de4396578f68dbea7dd9213bb555ba66
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.
include/land.h
include/prototypes.h
src/lib/commands/mfir.c
src/lib/subs/landgun.c
src/lib/subs/lndsub.c
src/lib/subs/mission.c