Planes get to sweep and sonar only after flak and interception
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Jun 2010 07:33:24 +0000 (09:33 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 25 Jul 2010 16:23:45 +0000 (18:23 +0200)
If defenders get to shoot before bombs are dropped, they surely get to
shoot before time-consuming missions like sweep and sonar.

Sweep and sonar used to happen after air defense, but before flak and
interception.  Air defense existed from Chainsaw 3 to v4.3.19.

src/lib/subs/aircombat.c

index 2783d7682226874f55fe857e5a9307c35a0dfe82..c003bceb8561ef79ad73f6a5a28ecc6563aa06d5 100644 (file)
@@ -140,19 +140,14 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
            flags = pln_caps(bomb_list);
            if (opt_HIDDEN)
                setcont(player->cnum, sect.sct_own, FOUND_FLY);
-           if (sect.sct_type == SCT_WATER) {
+           if (sect.sct_type == SCT_WATER)
                pr("flying over %s at %s\n",
                   dchr[sect.sct_type].d_name, xyas(x, y, player->cnum));
-               if (mission_flags & PM_S)
-                   plane_sweep(bomb_list, x, y);
-               if (flags & P_A)
-                   plane_sona(bomb_list, x, y, &head);
-           } else if (flags & P_S)
+           else if (flags & P_S)
                satdisp_sect(&sect, flags & P_I ? 10 : 50);
            else
                look_at_sect(&sect, 25);
-           changed += map_set(player->cnum, sect.sct_x, sect.sct_y,
-                              dchr[sect.sct_type].d_mnem, 0);
+
            if (flags & P_S)
                satdisp_units(sect.sct_x, sect.sct_y);
            else {
@@ -167,12 +162,11 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
                           cname(cn), xyas(x, y, player->cnum));
                }
            }
-       } else {
+       } else
            mpr(plane_owner, "flying over %s at %s\n",
                dchr[sect.sct_type].d_name, xyas(x, y, plane_owner));
-           changed += map_set(plane_owner, sect.sct_x, sect.sct_y,
-                              dchr[sect.sct_type].d_mnem, 0);
-       }
+       changed += map_set(plane_owner, sect.sct_x, sect.sct_y,
+                          dchr[sect.sct_type].d_mnem, 0);
 
        evaded = do_evade(bomb_list, esc_list);
        if (!evaded) {
@@ -209,6 +203,14 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
            }
        }
 
+       if (mission_flags & PM_R) {
+           flags = pln_caps(bomb_list);
+           if (sect.sct_type == SCT_WATER && mission_flags & PM_S)
+               plane_sweep(bomb_list, x, y);
+           if (sect.sct_type == SCT_WATER && flags & P_A)
+               plane_sona(bomb_list, x, y, &head);
+       }
+
        dir = *path++;
        if (!dir || QEMPTY(bomb_list) || (val = diridx(dir)) == DIR_STOP)
            break;