From ef6e2a9624759a90506b4a9773041c2ea5d2f8b5 Mon Sep 17 00:00:00 2001 From: PatR Date: Wed, 25 Feb 2026 18:30:11 -0800 Subject: [PATCH] fix #15306b - vision blocking sanity check Update vision affected by invisible mimics if polymorphing hero gains or loses See_invisibls. Avoids triggering a sanity_check impossisble if an invisible mimic is mimicking a boulder. --- src/polyself.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/polyself.c b/src/polyself.c index a990a4d5f..973cc053b 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 polyself.c $NHDT-Date: 1740534595 2025/02/25 17:49:55 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.223 $ */ +/* NetHack 3.7 polyself.c $NHDT-Date: 1772101811 2026/02/26 02:30:11 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.227 $ */ /* Copyright (C) 1987, 1988, 1989 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -201,7 +201,8 @@ polyman(const char *fmt, const char *arg) { boolean sticking = (sticks(gy.youmonst.data) && u.ustuck && !u.uswallow), was_mimicking = (U_AP_TYPE != M_AP_NOTHING); - boolean was_blind = !!Blind; + boolean was_blind = !!Blind, + had_see_invis = !!See_invisible; if (Upolyd) { u.acurr = u.macurr; /* restore old attribs */ @@ -245,6 +246,9 @@ polyman(const char *fmt, const char *arg) done(GENOCIDED); } + if (!!See_invisible ^ had_see_invis) + set_mimic_blocking(); /* See_invisible just toggled */ + if (u.twoweap && !could_twoweap(gy.youmonst.data)) untwoweapon();