extern void pln_mine(struct emp_qelem *list, struct sctstr *sectp);
extern int pln_capable(struct plnstr *, int, int);
extern int pln_airbase_ok(struct plnstr *, int, int);
-extern int carrier_planes(struct shpstr *);
+extern int carrier_planes(struct shpstr *, int);
extern void pln_sel(struct nstr_item *, struct emp_qelem *,
struct sctstr *, int, int, int, int);
extern int pln_arm(struct emp_qelem *, int, char, struct ichrstr *,
if (ship.shp_own != own
&& getrel(getnatp(ship.shp_own), own) != ALLIED)
continue;
- if ((carrier_planes(&ship) & (P_L | P_K)) == 0)
+ if ((carrier_planes(&ship, 0) & (P_L | P_K)) == 0)
continue;
if (first) {
pr(" # owner eff type\n");
xyas(target->sct_x, target->sct_y, player->cnum));
continue;
}
- fl = carrier_planes(&ship);
+ fl = carrier_planes(&ship, 0);
if (fl == 0) {
pr("Can't land on %s.\n", prship(&ship));
continue;
}
/*
- * Find non-missile plane types that can operate from carrier SP.
+ * Find plane types that can operate from carrier SP.
+ * If MSL find missile types, else non-missile types.
* Return a combination of P_L, P_K, P_E.
* It's zero if SP can't support air operations due to its type or
* state (low efficiency).
*/
int
-carrier_planes(struct shpstr *sp)
+carrier_planes(struct shpstr *sp, int msl)
{
struct mchrstr *mcp = mchr + sp->shp_type;
int res;
res = 0;
if (mcp->m_flags & M_FLY)
res |= P_L;
- if (mcp->m_flags & M_CHOPPER)
+ if ((mcp->m_flags & M_MSL) && msl)
+ res |= P_L;
+ if ((mcp->m_flags & M_CHOPPER) && !msl)
res |= P_K;
if (mcp->m_flags & M_XLIGHT)
res |= P_E;
prplane(pp));
return 0;
}
- if ((carrier_planes(&ship) & pcp->pl_flags) == 0)
+ if (!(carrier_planes(&ship, pcp->pl_flags & P_M) & pcp->pl_flags))
return 0;
} else if (pp->pln_land >= 0) {