From ea93842927e27fad17a13b94fb2c142dbadd2bd5 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 22 Dec 2005 19:48:33 +0000 Subject: [PATCH] (pln_equip): New mission argument 'm' for mining. 'd' is now for cargo drops only. Callers changed. --- src/lib/commands/drop.c | 3 ++- src/lib/subs/plnsub.c | 16 +++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/lib/commands/drop.c b/src/lib/commands/drop.c index ed8b7e36..f4da4583 100644 --- a/src/lib/commands/drop.c +++ b/src/lib/commands/drop.c @@ -120,7 +120,8 @@ drop(void) mission_flags |= P_X; /* stealth (shhh) */ mission_flags |= P_H; /* gets turned off if not all choppers */ mission_flags |= P_MINE; - mission_flags = pln_arm(&bomb_list, 2 * ap_to_target, 'd', + mission_flags = pln_arm(&bomb_list, 2 * ap_to_target, + wantflags & P_MINE ? 'm' : 'd', ip, 0, mission_flags); if (QEMPTY(&bomb_list)) { pr("No planes could be equipped for the mission.\n"); diff --git a/src/lib/subs/plnsub.c b/src/lib/subs/plnsub.c index d0c9aafe..ab7f6cf4 100644 --- a/src/lib/subs/plnsub.c +++ b/src/lib/subs/plnsub.c @@ -651,23 +651,17 @@ pln_equip(struct plist *plp, struct ichrstr *ip, int flags, s_char mission) } break; case 't': + case 'd': if ((pcp->pl_flags & P_C) == 0 || ip == 0) break; itype = ip->i_vtype; needed = (pp->pln_load * 2) / ip->i_lbs; break; - case 'd': - itype = ip->i_vtype; + case 'm': + if ((pcp->pl_flags & P_MINE) == 0) + break; + itype = I_SHELL; needed = (pp->pln_load * 2) / ip->i_lbs; - /* Is this mine dropping excursion? */ - if (itype == I_SHELL && (pcp->pl_flags & P_MINE)) - break; - /* Is this a cargo drop? */ - if ((pcp->pl_flags & P_C) == 0 || ip == 0) { - itype = 0; - needed = 0; - break; - } break; case 'a': if ((pcp->pl_flags & (P_V | P_C)) == 0)