A reconnaissance patrol (recon and sweep) uses sonar when ASW planes
participate. ac_encounter() enabled sonar when P_A was in
mission_flags. These get computed by pln_arm() and callers. However,
they set P_A only when *all* planes were capable, including escorts.
Fix by checking actual plane capabilities instead. Closes #
1389451.
*/
mission_flags |= P_X; /* stealth (shhh) */
mission_flags |= P_H; /* gets turned off if not all choppers */
- mission_flags |= P_A;
mission_flags = pln_arm(&bomb_list, ap_to_target, 'r',
0, P_S | P_I, mission_flags);
if (QEMPTY(&bomb_list)) {
PR(plane_owner, "\nSPY Plane report\n");
PRdate(plane_owner);
sathead();
- } else if (mission_flags & P_A) {
+ } else if (flags & P_A) {
PR(plane_owner, "\nAnti-Sub Patrol report\n");
} else {
PR(plane_owner, "\nReconnaissance report\n");
dchr[sect.sct_type].d_name, xyas(x, y, plane_owner));
if (mission_flags & PM_S)
plane_sweep(bomb_list, x, y);
- if (mission_flags & P_A) {
+ if (flags & P_A)
plane_sona(bomb_list, x, y, &head);
- }
changed += map_set(plane_owner,
sect.sct_x, sect.sct_y,
dchr[sect.sct_type].d_mnem, 0);
}
}
out:
- if (mission_flags & P_A)
- free_shiplist(&head);
+ free_shiplist(&head);
for (cn = 1; cn < MAXNOC; cn++) {
if (gotilist[cn])
pln_put(&ilist[cn]);
if (!(plp->pcp->pl_flags & P_X))
/* no stealth on this mission */
mission_flags &= ~P_X;
- if (!(plp->pcp->pl_flags & P_A)) {
- /* no asw on this mission */
- mission_flags &= ~P_A;
- }
if (!(plp->pcp->pl_flags & P_MINE)) {
/* no asw on this mission */
mission_flags &= ~P_MINE;
if (!(plp->pcp->pl_flags & P_X))
/* no stealth on this mission */
mission_flags &= ~P_X;
- if (!(plp->pcp->pl_flags & P_A)) {
- /* no asw on this mission */
- mission_flags &= ~P_A;
- /* FIXME escorts turn ASW patrol into ordinary recon */
- }
if (!(plp->pcp->pl_flags & P_MINE)) {
/* no asw on this mission */
mission_flags &= ~P_MINE;