Simplify ac_encounter()'s logic for stealthy evasion
This commit is contained in:
parent
e8adf2dafb
commit
80cf1b5be0
1 changed files with 13 additions and 17 deletions
|
@ -200,10 +200,10 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
evaded = do_evade(bomb_list, esc_list);
|
evaded = do_evade(bomb_list, esc_list);
|
||||||
|
if (evaded)
|
||||||
|
continue;
|
||||||
|
|
||||||
if (sect.sct_own != 0 && sect.sct_own != plane_owner && !evaded) {
|
if (sect.sct_own != 0 && sect.sct_own != plane_owner) {
|
||||||
/* We only show planes overhead if they didn't
|
|
||||||
* evade radar */
|
|
||||||
overfly[sect.sct_own]++;
|
overfly[sect.sct_own]++;
|
||||||
PR(sect.sct_own, "%s planes spotted over %s\n",
|
PR(sect.sct_own, "%s planes spotted over %s\n",
|
||||||
cname(plane_owner), xyas(x, y, sect.sct_own));
|
cname(plane_owner), xyas(x, y, sect.sct_own));
|
||||||
|
@ -211,28 +211,24 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
|
||||||
setcont(sect.sct_own, plane_owner, FOUND_FLY);
|
setcont(sect.sct_own, plane_owner, FOUND_FLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!evaded) {
|
/* Fire flak */
|
||||||
/* Fire flak */
|
if (unfriendly[sect.sct_own])
|
||||||
if (unfriendly[sect.sct_own])
|
ac_doflak(bomb_list, §);
|
||||||
ac_doflak(bomb_list, §);
|
/* If bombers left, fire flak from units and ships */
|
||||||
/* If bombers left, fire flak from units and ships */
|
if (!QEMPTY(bomb_list))
|
||||||
if (!QEMPTY(bomb_list))
|
ac_landflak(bomb_list, x, y);
|
||||||
ac_landflak(bomb_list, x, y);
|
if (!QEMPTY(bomb_list))
|
||||||
if (!QEMPTY(bomb_list))
|
ac_shipflak(bomb_list, x, y);
|
||||||
ac_shipflak(bomb_list, x, y);
|
|
||||||
}
|
|
||||||
/* mission planes aborted due to flak -- don't send escorts */
|
/* mission planes aborted due to flak -- don't send escorts */
|
||||||
if (QEMPTY(bomb_list))
|
if (QEMPTY(bomb_list))
|
||||||
break;
|
break;
|
||||||
if (!no_air_defense && !evaded)
|
|
||||||
|
if (!no_air_defense)
|
||||||
air_defense(x, y, plane_owner, bomb_list, esc_list);
|
air_defense(x, y, plane_owner, bomb_list, esc_list);
|
||||||
|
|
||||||
if (sect.sct_own == 0 || sect.sct_own == plane_owner)
|
if (sect.sct_own == 0 || sect.sct_own == plane_owner)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (evaded)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if (unfriendly[sect.sct_own] && !gotilist[sect.sct_own]) {
|
if (unfriendly[sect.sct_own] && !gotilist[sect.sct_own]) {
|
||||||
getilist(&ilist[sect.sct_own], sect.sct_own);
|
getilist(&ilist[sect.sct_own], sect.sct_own);
|
||||||
gotilist[sect.sct_own]++;
|
gotilist[sect.sct_own]++;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue