From d02028fe6640019f673db4dae221b37130088fb4 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 5 Jun 2024 22:58:44 -0700 Subject: [PATCH] more issue #1253 - shape change vs Eleberth I happened to restore a save file left over from testing yesterday's attempt to fix github issue #1253 and had a werejackal change from human to beast while next to my hero on "Elbereth", then attack me. This should be sufficient to prevent that. I'm not sure why the previous fix attempt seemed to be adequate when testing it. The new fix relies on the previous one. --- src/mhitu.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mhitu.c b/src/mhitu.c index 412ccc717..09325af0a 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -671,7 +671,15 @@ mattacku(struct monst *mtmp) also, were creature might change from human to animal or vice versa */ if (mtmp->cham == NON_PM && !mtmp->mcan && !range2 && (is_demon(mdat) || is_were(mdat))) { + boolean already_fleeing = mtmp->mflee != 0; + summonmu(mtmp, youseeit); + /* were-creature might have changed to beast form; if that has + caused it to become afraid (due to non-human reacting to scroll + of scare monster or engraved "Elbereth" which was being ignored + while in human form), don't continue this attack */ + if (mtmp->mflee && !already_fleeing) + return 0; mdat = mtmp->data; /* update cached value in case of were change */ }