From: Pasi Kallinen Date: Wed, 15 Feb 2023 09:24:01 +0000 (+0200) Subject: Fix angering monsters with non-hero magic rays X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=91dc1ea834a3fb00f42543c9f55d9dbf2417e293;p=nethack Fix angering monsters with non-hero magic rays 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. --- diff --git a/src/zap.c b/src/zap.c index fa236d03a..c37daf8e2 100644 --- 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;