]> granicus.if.org Git - nethack/commitdiff
poly'd hero mimic hiding vs polymorph
authornethack.rankin <nethack.rankin>
Sat, 13 Jun 2009 02:10:21 +0000 (02:10 +0000)
committernethack.rankin <nethack.rankin>
Sat, 13 Jun 2009 02:10:21 +0000 (02:10 +0000)
     From a bug report, if you were a mimic
who was hiding (via #monster, becoming a strange object) and polymorphed
into some other monster type, you retained the hidden/object form.  That
didn't happen when reverting to normal form, or when polymorphing into a
monster while involuntarily mimicking gold, but handling for the latter
inadvertently blocked dealing with the hiding-voluntarily case.

doc/fixes34.4
src/polyself.c

index 41281b004cb063af257c9bc06fca958e2c29856e..d99322ad40772eb7dccfa7c9225df5f2795686cd 100644 (file)
@@ -380,6 +380,8 @@ if life-saved steed became untame, repeated "placing steed onto map?" warnings
        would be given as long as the hero remained mounted
 trying to move down while levitating said "you are floating high above floor"
        even when being stuck in floor or lava blocked full levitation
+hero poly'd into mimic and hiding as an object via #monster didn't unhide
+       when polymorphing into non-mimic
 
 
 Platform- and/or Interface-Specific Fixes
index 9374c60397fe002809e3e5b5d3bf6159613baf59..d010416fa45c3479632fc5768c47b8bc3354de74 100644 (file)
@@ -1,5 +1,4 @@
 /* NetHack 3.5 polyself.c      $Date$  $Revision$ */
-/*     SCCS Id: @(#)polyself.c 3.5     2007/04/07      */
 /*     Copyright (C) 1987, 1988, 1989 by Ken Arromdee */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -460,10 +459,12 @@ int       mntmp;
                flags.female = u.mfemale;
        }
 
-       if (youmonst.m_ap_type) {
-           /* stop mimicking immediately */
-           if (multi < 0) unmul("");
-       } else if (mons[mntmp].mlet != S_MIMIC) {
+       /* if stuck mimicking gold, stop immediately */
+       if (multi < 0 && youmonst.m_ap_type == M_AP_OBJECT &&
+               youmonst.data->mlet != S_MIMIC)
+           unmul("");
+       /* if becoming a non-mimic, stop mimicking anything */
+       if (mons[mntmp].mlet != S_MIMIC) {
            /* as in polyman() */
            youmonst.m_ap_type = M_AP_NOTHING;
        }