]> git.pond.sub.org Git - empserver/commit
Fix update to take dead units off carriers
authorMarkus Armbruster <armbru@pond.sub.org>
Wed, 15 Apr 2009 21:06:54 +0000 (23:06 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 15 Apr 2009 21:07:26 +0000 (23:07 +0200)
commit56f2ca96f70cefdd6b70bb68fb06e29b5a6ac364
tree1f0fa375fc18901a8dd5c9a048116a6236ed5670
parent2900de1f631976e96d556d85e70a385e927ae5da
Fix update to take dead units off carriers

upd_plane() upd_land() and left planes and land units lost to lack of
maintenance on their carriers.  Cargo lists were fine anyway, because
unit_cargo_init() ignored dead units.  But when the dead unit got
reused for building a new one, pln_prewrite() / lnd_prewrite() got
confused and attempted to take it off its carrier, which made
clink_rem() oops, because the unit wasn't on the cargo list.  No real
harm done, as oops recovery was fine.

Fix upd_plane() and upd_land() to clear the carrier.  Make
unit_cargo_init() oops when it finds dead units on carriers.
(cherry picked from commit c2c0d1ff77fef3adb0b8517c494838119b9b236f)
src/lib/common/cargo.c
src/lib/update/land.c
src/lib/update/plane.c