drop and fly from carrier can fail to load last civ or mil
authorMarkus Armbruster <armbru@pond.sub.org>
Sat, 26 Nov 2011 21:48:28 +0000 (22:48 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 29 Dec 2011 10:47:07 +0000 (11:47 +0100)
pln_equip() refuses to abandon its base sector.  Unfortunately, it
checks even when flying off carriers, and refuses to load the last
civilian or military depending on what happens to be in uninitialized
variable sect.

Broken in commit 91139692, v4.3.0.

src/lib/subs/plnsub.c

index a167f636f0bf4677baaf0bdb9811a89584ca190f..ee2fb655ea617fb7b62d5dde07371e88f513c96f 100644 (file)
@@ -720,7 +720,10 @@ pln_equip(struct plist *plp, struct ichrstr *ip, char mission)
                                         plp->plane.pln_y,
                                         I_SHELL, needed);
 #endif
-       abandon_needed = !!would_abandon(&sect, itype, needed, NULL);
+       if (pp->pln_ship >= 0 || pp->pln_land >= 0)
+           abandon_needed = 0;
+       else
+           abandon_needed = !!would_abandon(&sect, itype, needed, NULL);
        if (item[itype] < needed + abandon_needed) {
            pr("Not enough %s for %s\n", ichr[itype].i_name, prplane(pp));
            return -1;