add_to_fired_queue() adds a defender at most once. It neglects to
free the defender flist nodes it doesn't add. Broken since option
MULTIFIRE appeared in Chainsaw.
/* Don't put them on the list if they're already there */
for (qp = list->q_forw; qp != list; qp = qp->q_forw) {
fp = (struct flist *)qp;
- if (fp->type != targ_land && fp->uid == ep->uid)
- return;
- if (fp->type != targ_land
- && fp->x == ep->x && fp->y == ep->y)
+ if (fp->type == targ_land
+ ? fp->x == ep->x && fp->y == ep->y
+ : fp->uid == ep->uid) {
+ free(ep);
return;
+ }
}
emp_insque(elem, list);
}