empserver/include
Markus Armbruster 22c6fd8bf6 Factor out common ship gun fire code into shp_fire()
This takes care of a number of bugs / inconsistencies:

* Ships with zero firing range could return fire and fire support, but
  not fire actively or interdict.  Fix by testing for gun limit
  instead in multifire() and mission().  No ships in the stock game
  are affected.

* Required gun crew was inconsistent: multifire() let N military fire
  max(1,floor(N/2)) guns for active fire.  Ditto perform_mission() for
  interdiction.  quiet_bigdef() let them fire N guns for returning gun
  fire.  Ditto sd() for firing support and firing at boarding parties.
  fire_dchrg() let them fire floor(N/2) for returning fire to
  torpedoes.  Unify to let N military fire floor((N+1)/2) guns.

* Shell use was inconsistent: sd() and perform_mission() used one
  shell per gun, everything else one per two guns.  Unify to one shell
  per two guns.

* Shell resupply bugs: multifire() got two shells regardless of actual
  ammo use.  quiet_bigdef() got one shell (but use_ammo() uses only
  one, which is a bug).  sd() and perform_mission() resupplied before
  checking all other requirements and could thus get more shells than
  actually needed.
2008-03-14 20:25:37 +01:00
..
budg.h Update copyright notice 2008-01-19 10:15:37 +01:00
com.h Update copyright notice 2008-01-19 10:15:37 +01:00
combat.h Update copyright notice 2008-01-19 10:15:37 +01:00
commands.h Update copyright notice 2008-01-19 10:15:37 +01:00
commodity.h Extend the common header of struct empobj to include uid 2008-03-05 22:48:20 +01:00
damage.h Update copyright notice 2008-01-19 10:15:37 +01:00
distribute.h Update copyright notice 2008-01-19 10:15:37 +01:00
econfig-spec.h Make econfig keys data and info work for relative names 2008-02-07 08:01:54 +01:00
empio.h Update copyright notice 2008-01-19 10:15:37 +01:00
empobj.h Rename emp_obj_chr_name() to empobj_chr_name() 2008-03-14 20:25:09 +01:00
empthread.h Update copyright notice 2008-01-19 10:15:37 +01:00
file.h New ef_truncate() 2008-03-14 20:25:10 +01:00
game.h Extend the common header of struct empobj to include uid 2008-03-05 22:48:20 +01:00
ioqueue.h Update copyright notice 2008-01-19 10:15:37 +01:00
item.h Update copyright notice 2008-01-19 10:15:37 +01:00
journal.h Update copyright notice 2008-01-19 10:15:37 +01:00
land.h New unit stat development functions 2008-03-14 20:25:10 +01:00
loan.h Extend the common header of struct empobj to include uid 2008-03-05 22:48:20 +01:00
lost.h Initialize ef_type and uid automatically in ef_extend() 2008-03-05 22:48:23 +01:00
lwp.h Semaphores are no longer used, remove: 2007-02-08 12:29:16 +00:00
map.h Get rid of src/lib/gen/copy.c 2008-02-03 07:44:20 +01:00
match.h Update copyright notice 2008-01-19 10:15:37 +01:00
misc.h Update copyright notice 2008-01-19 10:15:37 +01:00
mission.h Update copyright notice 2008-01-19 10:15:37 +01:00
nat.h Extend the common header of struct empobj to include uid 2008-03-05 22:48:20 +01:00
news.h Check subscript of rpt[] 2008-03-14 20:25:08 +01:00
nsc.h Clean up initialization of nat_ca[] 2008-02-10 11:40:57 +01:00
nuke.h Extend the common header of struct empobj to include uid 2008-03-05 22:48:20 +01:00
optlist.h Make econfig keys data and info work for relative names 2008-02-07 08:01:54 +01:00
path.h Update copyright notice 2008-01-19 10:15:37 +01:00
plague.h Update copyright notice 2008-01-19 10:15:37 +01:00
plane.h New unit stat development functions 2008-03-14 20:25:10 +01:00
player.h Update copyright notice 2008-01-19 10:15:37 +01:00
power.h Update copyright notice 2008-01-19 10:15:37 +01:00
product.h Update copyright notice 2008-01-19 10:15:37 +01:00
proto.h Update copyright notice 2008-01-19 10:15:37 +01:00
prototypes.h Factor out common fortress fire code into fort_fire() 2008-03-14 20:25:37 +01:00
queue.h Update copyright notice 2008-01-19 10:15:37 +01:00
retreat.h Update copyright notice 2008-01-19 10:15:37 +01:00
sect.h Factor out common fortress fire code into fort_fire() 2008-03-14 20:25:37 +01:00
server.h Update copyright notice 2008-01-19 10:15:37 +01:00
service.h Update copyright notice 2008-01-19 10:15:37 +01:00
ship.h Factor out common ship gun fire code into shp_fire() 2008-03-14 20:25:37 +01:00
tel.h Update copyright notice 2008-01-19 10:15:37 +01:00
trade.h Extend the common header of struct empobj to include uid 2008-03-05 22:48:20 +01:00
treaty.h Extend the common header of struct empobj to include uid 2008-03-05 22:48:20 +01:00
types.h Update copyright notice 2008-01-19 10:15:37 +01:00
unit.h Update copyright notice 2008-01-19 10:15:37 +01:00
update.h Update copyright notice 2008-01-19 10:15:37 +01:00
version.h Update copyright notice 2008-01-19 10:15:37 +01:00
xy.h Update copyright notice 2008-01-19 10:15:37 +01:00