No need to take dead planes off carrier anymore

Until commit 3e370da5, dead planes had to be explicitely taken off
their carrier to update load counters.  This is no longer necessary;
simplify pln_put1() and scut().  scut() got it wrong, by the way: it
failed to take planes off land units.
This commit is contained in:
Markus Armbruster 2008-09-14 09:53:08 -04:00
parent 87c3ca9cca
commit 4478df7da6
2 changed files with 1 additions and 16 deletions

View file

@ -143,12 +143,6 @@ scut(void)
scuttle_land(&item.land);
} else {
pr("%s", prplane(&item.plane));
if (item.plane.pln_ship >= 0) {
struct shpstr ship;
getship(item.plane.pln_ship, &ship);
take_plane_off_ship(&item.plane, &ship);
}
item.plane.pln_effic = 0;
putplane(item.plane.pln_uid, &item.plane);
}

View file

@ -756,7 +756,6 @@ pln_put1(struct plist *plp)
{
struct plnstr *pp;
struct shpstr ship;
struct lndstr land;
struct sctstr sect;
pp = &plp->plane;
@ -769,15 +768,7 @@ pln_put1(struct plist *plp)
if (!(pp->pln_flags & PLN_LAUNCHED))
; /* never took off */
else if (pp->pln_effic < PLANE_MINEFF) {
/* destroyed */
if (pp->pln_ship >= 0) {
getship(pp->pln_ship, &ship);
take_plane_off_ship(pp, &ship);
}
if (pp->pln_land >= 0) {
getland(pp->pln_land, &land);
take_plane_off_land(pp, &land);
}
; /* destroyed */
} else if (pp->pln_ship >= 0) {
/* It is landing on a carrier */
getship(pp->pln_ship, &ship);