]> git.pond.sub.org Git - empserver/commitdiff
No need to take dead planes off carrier anymore
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 14 Sep 2008 13:53:08 +0000 (09:53 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 14 Sep 2008 14:21:27 +0000 (10:21 -0400)
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.

src/lib/commands/scut.c
src/lib/subs/plnsub.c

index f6847a29ace2ed65a46aba727ebcad07bbe511c3..7c6b45927e18671f9a3ccd73141fb1824ab068fd 100644 (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);
        }
index 61fac77bb0d9758f3f7004e4131f3a59fdcbcd15..45eb43714a089a7003122542461ce98d2fb5cf7e 100644 (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);