empserver/include
Markus Armbruster 3e370da58c Get rid of ship and land unit load counters
Load counters are redundant; they can be computed from the carrier
uids.  Keeping them up-to-date as the carriers change is a pain, and
we never got that quite complete.

Computing load counters straight from the carrier uids every time we
need them would be rather inefficient, but computing them from cargo
lists is not.  So do that.

Remove the load counters: struct shpstr members shp_nplane,
shp_nchoppers, shp_nxlight, shp_nland, and struct lndstr members
lnd_nxlight and lnd_nland.

Don't compute/update load counters in build_ship(), build_land(),
land(), ldump(), load_plane_ship(), load_land_ship(),
load_plane_land(), load_land_land(), lstat(), sdump(), shi(), sstat(),
tend_land(), check_trade(), put_combat(), pln_oneway_to_carrier_ok),
pln_newlanding(), fit_plane_on_ship(), fit_plane_on_land(),
unit_list().

Nothing left in fit_plane_off_ship(), fit_plane_off_land(), so remove
them.

load_land_ship(), load_land_land(), check_trade(), pln_newlanding(),
put_plane_on_ship(), take_plane_off_ship(), put_plane_on_land(),
take_plane_off_land() no longer change the carrier, so don't put it.

Remove functions to recompute the load counters from carrier uids:
count_units(), lnd_count_units(), count_planes(), count_land_planes(),
pln_fixup() and lnd_fixup(), along with the latter two's private
copies of fit_plane_on_ship() and fit_plane_on_land().

New cargo list functions to compute load counts: unit_cargo_count()
and unit_nplane(), with convenience wrappers shp_nplane(),
shp_nland(), lnd_nxlight(), lnd_nland().

Use them to make ship selectors nplane, nchoppers, nxlight, nland
virtual.  They now reflect what is loaded, not how the load uses the
available slots.  This makes a difference when x-light planes or
choppers use plane slots.

Use them to make land unit selectors nxlight and nland virtual.

Use them to get load counts in land(), ldump(), load_plane_ship(),
load_land_ship(), load_plane_land(), load_land_land(), sdump(), shi(),
tend_land(), fit_plane_on_land(), trade_desc(), unit_list().

Rewrite fit_plane_on_ship() and could_be_on_ship() to use
shp_nplane().  could_be_on_ship() now takes load count arguments, as
computed by shp_nplane(), so it can be used for checking against an
existing load as well.
2008-09-08 21:32:56 -04: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 Add sequence numbers to game state 2008-05-17 22:50:30 +02: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 Remove option FUEL 2008-05-12 09:25:20 +02:00
empio.h Update copyright notice 2008-01-19 10:15:37 +01:00
empobj.h Add sequence numbers to game state 2008-05-17 22:50:30 +02:00
empthread.h Update copyright notice 2008-01-19 10:15:37 +01:00
file.h New struct empfile callback onresize 2008-09-08 21:30:37 -04:00
game.h Add sequence numbers to game state 2008-05-17 22:50:30 +02:00
ioqueue.h Update copyright notice 2008-01-19 10:15:37 +01:00
item.h Replace some typedef names by enum tags. 2008-03-14 20:25:42 +01:00
journal.h Update known contributors comments 2008-08-03 08:04:08 -04:00
land.h Get rid of ship and land unit load counters 2008-09-08 21:32:56 -04:00
loan.h Add sequence numbers to game state 2008-05-17 22:50:30 +02:00
lost.h New lost_and_found() to record ownership changes. 2008-09-08 21:28:29 -04:00
lwp.h Semaphores are no longer used, remove: 2007-02-08 12:29:16 +00:00
map.h Fix MAPWIDTH() for arguments other than 1 2008-08-20 07:40:51 -04:00
match.h Update copyright notice 2008-01-19 10:15:37 +01:00
misc.h Get rid of RET_SYS, just use RET_FAIL 2008-08-03 11:34:00 -04:00
mission.h Update copyright notice 2008-01-19 10:15:37 +01:00
nat.h Fix xdump realm to dump player instead of absolute coordinates 2008-08-26 21:42:32 -04:00
news.h Add sequence numbers to game state 2008-05-17 22:50:30 +02:00
nsc.h Make xundump oops on virtual selectors 2008-05-12 11:26:41 +02:00
nuke.h Enable the new nuk_on_plane(), replacing the old one 2008-09-08 21:32:52 -04:00
optlist.h Update known contributors comments 2008-03-14 20:25:44 +01:00
path.h Simplify routech[] 2008-08-27 21:30:56 -04:00
plague.h Update copyright notice 2008-01-19 10:15:37 +01:00
plane.h Get rid of struct plnstr member pln_nuktype 2008-09-08 21:32:53 -04:00
player.h Fix treatment of EOF from player 2008-07-15 06:35:56 -04: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 Get rid of ship and land unit load counters 2008-09-08 21:32:56 -04:00
queue.h New emp_searchque() 2008-03-14 21:00:29 +01:00
retreat.h Update copyright notice 2008-01-19 10:15:37 +01:00
sect.h Add sequence numbers to game state 2008-05-17 22:50:30 +02:00
server.h Update known contributors comments 2008-08-03 08:04:08 -04:00
service.h Update copyright notice 2008-01-19 10:15:37 +01:00
ship.h Get rid of ship and land unit load counters 2008-09-08 21:32:56 -04:00
tel.h Update copyright notice 2008-01-19 10:15:37 +01:00
trade.h Add sequence numbers to game state 2008-05-17 22:50:30 +02:00
treaty.h Add sequence numbers to game state 2008-05-17 22:50:30 +02:00
types.h Update copyright notice 2008-01-19 10:15:37 +01:00
unit.h Get rid of ship and land unit load counters 2008-09-08 21:32:56 -04: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
xdump.h Give some identifiers internal linkage 2008-08-09 08:40:04 -04:00
xy.h Rework code dealing with struct range fixing many bugs 2008-08-20 07:40:32 -04:00