From 062a42fb7b474b615a7f87749e793134e1ad41b4 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 27 Sep 2009 09:31:50 -0400 Subject: [PATCH] Make passing paradrop & mine cargo to pln_arm() & friends optional 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 | 2 +- src/lib/subs/mission.c | 2 +- src/lib/subs/plnsub.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/commands/para.c b/src/lib/commands/para.c index 869b38ef..a2dee2c5 100644 --- a/src/lib/commands/para.c +++ b/src/lib/commands/para.c @@ -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; diff --git a/src/lib/subs/mission.c b/src/lib/subs/mission.c index d94c7058..b63f01af 100644 --- a/src/lib/subs/mission.c +++ b/src/lib/subs/mission.c @@ -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) { diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index 3bbe049f..0bdf30c2 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -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 */