Fix another "no monster to remove" impossible

Pet ranged attack code was using the same variable for
both pet attacking a monster and then the monster's possible
retaliation attack. The retaliation obviously overwrote the
pet attack return code, allowing pet to move afterwards.
In certain case this could result in "no monster to remove"
warning.
This commit is contained in:
Pasi Kallinen
2023-05-07 21:57:32 +03:00
parent 2de3409113
commit 3ffb69bf2f

View File

@@ -917,8 +917,9 @@ pet_ranged_attk(struct monst *mtmp)
* if it's blind or unseeing, it can't retaliate
*/
if (mtarg->mcansee && haseyes(mtarg->data)) {
mstatus = mattackm(mtarg, mtmp);
if (mstatus & M_ATTK_DEF_DIED)
int mresp = mattackm(mtarg, mtmp);
if (mresp & M_ATTK_DEF_DIED)
return MMOVE_DIED;
}
}