Fix SAM interception for intercepts other than the first
A country's SAMs launched only in the first interception of a sortie. That was because ac_intercept() made sam_intercept() delete all SAMs from the list of available interceptors. sam_intercept() also deleted any SAMs out of range. Don't do that, delete unused SAMs along with other unused interceptors on return from ac_encounter().
This commit is contained in:
parent
b54454fbc4
commit
7b4c0d171f
1 changed files with 2 additions and 5 deletions
|
@ -348,11 +348,8 @@ sam_intercept(struct emp_qelem *att_list, struct emp_qelem *def_list,
|
|||
continue;
|
||||
|
||||
if (dplp->plane.pln_range <
|
||||
mapdist(x, y, dplp->plane.pln_x, dplp->plane.pln_y)) {
|
||||
emp_remque(dqp);
|
||||
free(dqp);
|
||||
mapdist(x, y, dplp->plane.pln_x, dplp->plane.pln_y))
|
||||
continue;
|
||||
}
|
||||
if (CANT_HAPPEN(dplp->plane.pln_flags & PLN_LAUNCHED)
|
||||
|| mission_pln_equip(dplp, 0, P_F, 0) < 0) {
|
||||
emp_remque(dqp);
|
||||
|
@ -408,7 +405,7 @@ ac_intercept(struct emp_qelem *bomb_list, struct emp_qelem *esc_list,
|
|||
plane_owner = plp->plane.pln_own;
|
||||
|
||||
sam_intercept(bomb_list, def_list, def_own, plane_owner, x, y, 0);
|
||||
sam_intercept(esc_list, def_list, def_own, plane_owner, x, y, 1);
|
||||
sam_intercept(esc_list, def_list, def_own, plane_owner, x, y, 0);
|
||||
|
||||
att_count = 0;
|
||||
for (qp = bomb_list->q_forw; qp != bomb_list; qp = qp->q_forw)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue