]> 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:06:54 +0000 (23:06 +0200)
commitc2c0d1ff77fef3adb0b8517c494838119b9b236f
treea6f99780aa8f980caf2eaeebd8e2d2fd78a8dcca
parent627eb9bc1a0c9534da9d841a6ba8479bc0fcc327
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.
src/lib/common/cargo.c
src/lib/update/land.c
src/lib/update/plane.c