}
static struct ulist *
-most_valuable_ship(struct emp_qelem *list)
+most_valuable_ship(struct emp_qelem *list, coord x, coord y)
{
struct emp_qelem *qp;
struct emp_qelem *next;
for (qp = list->q_back; qp != list; qp = next) {
next = qp->q_back;
mlp = (struct ulist *)qp;
+ if (mlp->unit.ship.shp_x != x || mlp->unit.ship.shp_y != y)
+ continue;
if (((struct mchrstr *)mlp->chrp)->m_flags & M_SUB)
continue;
if (!((struct mchrstr *)mlp->chrp)->m_nxlight &&
newqp = qp->q_back;
plp = (struct plist *)qp;
- mvs = most_valuable_ship(list);
+ mvs = most_valuable_ship(list, newx, newy);
if (mvs && mission_pln_equip(plp, NULL, 'p') >= 0) {
if (msl_hit(&plp->plane,
shp_hardtarget(&mvs->unit.ship),
shp_easiest_target(list, 0, M_SUB),
MI_INTERDICT),
0, M_SUB, newx, newy);
- if (most_valuable_ship(list)) {
+ if (most_valuable_ship(list, newx, newy)) {
stopping |=
shp_missile_interdiction(list, newx, newy, victim);
}
sprintf(buf, "%s", prship(&mlp->unit.ship));
eff = sp->shp_effic;
- if (most_valuable_ship(&list)) {
+ if (most_valuable_ship(&list, sp->shp_x, sp->shp_y)) {
shp_missile_interdiction(&list, sp->shp_x, sp->shp_y, sp->shp_own);
getship(sp->shp_uid, sp);