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.
This commit is contained in:
Markus Armbruster 2009-04-15 23:06:54 +02:00
parent 627eb9bc1a
commit c2c0d1ff77
3 changed files with 14 additions and 3 deletions

View file

@ -125,6 +125,7 @@ upd_land(struct lndstr *lp, int etus,
makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0;
lp->lnd_ship = lp->lnd_land = -1;
return;
}
wu(0, lp->lnd_own,