]> git.pond.sub.org Git - empserver/commitdiff
Make passing paradrop & mine cargo to pln_arm() & friends optional
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Sep 2009 13:31:50 +0000 (09:31 -0400)
committerMarkus Armbruster <armbru@pond.sub.org>
Tue, 8 Dec 2009 07:15:51 +0000 (08:15 +0100)
These missions imply the cargo type, just like bombing missions.  Use
the implied type instead of cargo type parameter ip there.  Parameter
ip is now optional except for missions 't' (transport) and 'd' (drop).

Simplify para() not to pass the optional cargo type.  Leave drop()
alone, because always passing the type is simpler there.

src/lib/commands/para.c
src/lib/subs/mission.c
src/lib/subs/plnsub.c

index 869b38ef99f1b19e126cede745eff9e8682ac465..a2dee2c5850c11028ec0c16a2c50b986e6937dee 100644 (file)
@@ -90,7 +90,7 @@ para(void)
     /*
      * now arm and equip the bombers, transports, whatever.
      */
-    pln_arm(&bomb_list, 2 * ap_to_target, 'a', &ichr[I_MILIT]);
+    pln_arm(&bomb_list, 2 * ap_to_target, 'a', NULL);
     if (QEMPTY(&bomb_list)) {
        pr("No planes could be equipped for the mission.\n");
        return RET_FAIL;
index d94c7058683648da8427b684457b49982d1ddfa4..b63f01af2a594409f70cf5905d25550abd7a9025 100644 (file)
@@ -920,7 +920,7 @@ mission_pln_equip(struct plist *plp, struct ichrstr *ip, char mission)
        if ((pcp->pl_flags & (P_V | P_C)) == 0)
            break;
        itype = I_MILIT;
-       needed = load / ip->i_lbs;
+       needed = load / ichr[I_MILIT].i_lbs;
        break;
     case 'i':          /* missile interception */
        if (load) {
index 3bbe049f352926d284320f7d686ac0b76b7238f4..0bdf30c2620c2307f45b2c4283db50875cf30108 100644 (file)
@@ -663,13 +663,13 @@ pln_equip(struct plist *plp, struct ichrstr *ip, char mission)
        if ((pcp->pl_flags & P_MINE) == 0)
            break;
        itype = I_SHELL;
-       needed = (load * 2) / ip->i_lbs;
+       needed = (load * 2) / ichr[I_SHELL].i_lbs;
        break;
     case 'a':          /* paradrop */
        if ((pcp->pl_flags & (P_V | P_C)) == 0)
            break;
        itype = I_MILIT;
-       needed = load / ip->i_lbs;
+       needed = load / ichr[I_MILIT].i_lbs;
        break;
     case 'r':          /* reconnaissance */
     case 'e':          /* escort */