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.
This commit is contained in:
Pasi Kallinen
2023-10-21 15:56:58 +03:00
parent f7e5437746
commit 69a4853851
2 changed files with 3 additions and 1 deletions

View File

@@ -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))

View File

@@ -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))