From 3ffb69bf2f4d9e1931332d7e0d48f15331095183 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sun, 7 May 2023 21:57:32 +0300 Subject: [PATCH] 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. --- src/dogmove.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dogmove.c b/src/dogmove.c index dc0f2b40c..ac19348a2 100644 --- a/src/dogmove.c +++ b/src/dogmove.c @@ -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; } }