From 69a4853851ea1daf01ae62be9997098091a8ade6 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Sat, 21 Oct 2023 15:56:58 +0300 Subject: [PATCH] Fix "no monster to remove" when tame nymph attacked A tame nymph attacked another monster, stole an item and teleported away, but dog_move() wasn't passed the information that the nymph was done, and tried to move the nymph from the old location. Same with a tame leprechaun. --- src/mhitm.c | 2 +- src/uhitm.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mhitm.c b/src/mhitm.c index cf25fed41..33d8af026 100644 --- a/src/mhitm.c +++ b/src/mhitm.c @@ -568,7 +568,7 @@ mattackm( if (res[i] & M_ATTK_AGR_DIED) return res[i]; /* return if aggressor can no longer attack */ - if (helpless(magr)) + if ((res[i] & M_ATTK_AGR_DONE) || helpless(magr)) return res[i]; /* eg. defender was knocked into a level teleport trap */ if (mon_offmap(mdef)) diff --git a/src/uhitm.c b/src/uhitm.c index 424b2b04a..911f16171 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -2727,6 +2727,7 @@ mhitm_ad_sgld( if (!tele_restrict(magr)) { boolean couldspot = canspotmon(magr); + mhm->hitflags = M_ATTK_AGR_DONE; (void) rloc(magr, RLOC_NOMSG); /* TODO: use RLOC_MSG instead? */ if (gv.vis && couldspot && !canspotmon(magr)) @@ -4567,6 +4568,7 @@ mhitm_ad_sedu( if (pa->mlet == S_NYMPH && !tele_restrict(magr)) { boolean couldspot = canspotmon(magr); + mhm->hitflags = M_ATTK_AGR_DONE; (void) rloc(magr, RLOC_NOMSG); /* TODO: use RLOC_MSG instead? */ if (gv.vis && couldspot && !canspotmon(magr))