]> granicus.if.org Git - nethack/commitdiff
Fix angering monsters with non-hero magic rays
authorPasi Kallinen <paxed@alt.org>
Wed, 15 Feb 2023 09:24:01 +0000 (11:24 +0200)
committerPasi Kallinen <paxed@alt.org>
Wed, 15 Feb 2023 09:28:09 +0000 (11:28 +0200)
Can't use gc.context.mon_moving to check if the ray was caused
by hero, as some rays can happen while hero is moving in response
to their action - for example a bolt of lightning from a god.
dobuzz() uses positive type values for magic rays caused by hero,
so just use that.

src/zap.c

index fa236d03a9068b0da681420da3a3ee36bd2e8dd3..c37daf8e2b5e027830ca5aa51b246fea164b6743 100644 (file)
--- a/src/zap.c
+++ b/src/zap.c
@@ -4482,7 +4482,7 @@ dobuzz(
                         if (mon_could_move && !mon->mcanmove) /* ZT_SLEEP */
                             slept_monst(mon);
                         if (abstype != ZT_SLEEP)
-                            wakeup(mon, !gc.context.mon_moving);
+                            wakeup(mon, (type >= 0) ? TRUE : FALSE);
                     }
                 }
                 range -= 2;