]> git.pond.sub.org Git - empserver/commit - src/lib/commands/load.c
Collect the test whether a plane fits on a carrier in one place:
authorMarkus Armbruster <armbru@pond.sub.org>
Tue, 30 Oct 2007 07:09:31 +0000 (07:09 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 30 Oct 2007 07:09:31 +0000 (07:09 +0000)
commit51165cf3fc47f1b144f0fe9c4e38aa5bfdb5b302
tree37fedbdae2de4cbc7364bc9db9d596937f8d7010
parentac20e6593051b94613818d17510b3dd5bc76c0f8
Collect the test whether a plane fits on a carrier in one place:
(fit_plane_on_ship, fit_plane_on_land): New.
(pln_oneway_to_carrier_ok, put_plane_on_ship, count_planes)
(put_plane_on_land, count_land_planes): Use them.  No functional
change.
(fit_plane_off_ship, fit_plane_off_land): New.
(take_plane_off_ship, take_plane_off_land): Use them.  This oopses
when the carriers plane counter underflows.

(take_plane_off_ship): Document that carrier's plane counters may be
screwed up.

(take_plane_off_ship, take_plane_off_land): Oops when the plane isn't
on the carrier.

(take_plane_off_ship, take_plane_off_land): Don't fail when the plane
to be taken off can't go on this type of carrier, just take it off.
No error condition left, so return void.  Callers couldn't do anything
useful with the status anyway, and most didn't bother.  Change those
that did.
include/prototypes.h
src/lib/commands/load.c
src/lib/subs/plnsub.c