]> granicus.if.org Git - nethack/commitdiff
fix github issue #432 - bad sanity check
authorPatR <rankin@nethack.org>
Tue, 29 Dec 2020 22:34:37 +0000 (14:34 -0800)
committerPatR <rankin@nethack.org>
Tue, 29 Dec 2020 22:34:37 +0000 (14:34 -0800)
The block of sanity check code that is causing impossible warnings
about the Wizard mimicking a monster was initially only used for
furniture and objects specifically because of the Wizard.  When it
got extended to check for mimicking monsters, an exception for the
Wizard was needed but not added.

Fixes #432

doc/fixes37.0
src/mon.c

index a50894cb1c3941885b8e6e1eb3c3f5459a8501e4..cacc868b0d9a4c7566f72dd3fb87408678413c40 100644 (file)
@@ -1,4 +1,4 @@
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.402 $ $NHDT-Date: 1608933417 2020/12/25 21:56:57 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.410 $ $NHDT-Date: 1609281273 2020/12/29 22:34:33 $
 
 General Fixes and Modified Features
 -----------------------------------
@@ -465,6 +465,7 @@ tilemap.c wasn't building if STATUES_LOOK_LIKE_MONSTERS wasn't defined; also,
 ensure that monster female name variation ends up as a female during ^G
 arbitrate when there is a conflict between gender term (male or female) and
        a gender-tied monster name (cavewoman) during ^G; gender term wins
+wizard mode sanity check complained about Wizard's clone mimicking a monster
 
 curses: 'msg_window' option wasn't functional for curses unless the binary
        also included tty support
index 1b13ddbd6de1e43db68586be8ccda7ea18ba48f3..346b21c0fdca9e64282ded8042540e96c5473319 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -1,4 +1,4 @@
-/* NetHack 3.7 mon.c   $NHDT-Date: 1609075599 2020/12/27 13:26:39 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.363 $ */
+/* NetHack 3.7 mon.c   $NHDT-Date: 1609281168 2020/12/29 22:32:48 $  $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.364 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /*-Copyright (c) Derek S. Ray, 2015. */
 /* NetHack may be freely redistributed.  See license for details. */
@@ -150,9 +150,12 @@ const char *msg;
             impossible(
                 "mimic%s concealed as %s despite Prot-from-shape-changers %s",
                        is_mimic ? "" : "ker", what, msg);
-        /* pet's quickmimic can take on furniture and object shapes,
-           but only until the pet finishes eating a mimic corpse */
-        if (!(is_mimic || mtmp->meating))
+        /* the Wizard's clone after "double trouble" starts out mimicking
+           some other monster; pet's quickmimic effect can temporarily take
+           on furniture, object, or monster shape, but only until the pet
+           finishes eating a mimic corpse */
+        if (!(is_mimic || mtmp->meating
+              || (mtmp->iswiz && M_AP_TYPE(mtmp) == M_AP_MONSTER)))
             impossible("non-mimic (%s) posing as %s (%s)",
                        mptr->pmnames[NEUTRAL], what, msg);
 #if 0   /* mimics who end up in strange locations do still hide while there */