From ad1dec0745e7caa46fc72f07af24ba531b1dccec Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sat, 13 Jun 2009 02:10:21 +0000 Subject: [PATCH] poly'd hero mimic hiding vs polymorph 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 | 2 ++ src/polyself.c | 11 ++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 41281b004..d99322ad4 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -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 diff --git a/src/polyself.c b/src/polyself.c index 9374c6039..d010416fa 100644 --- a/src/polyself.c +++ b/src/polyself.c @@ -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; }