From c2a3a3a38bddcb562fe99b8a0520d5522108f8ee Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Fri, 9 Feb 2007 00:25:47 +0000 Subject: [PATCH] fix #H239 - doppleganger/mimic bug From a bug report: a shapechanger which becomes a mimic would always stay as 'm' rather than take on object or furniture shape. Same applied to monsters which hide in other ways. The code did that deliberately, but I don't think that it's actually necessary so this lets them mimic/hide when they're in the right shape. If they change form to non-mimic/hider while concealed, concealment ends. It would be fun to have shapechangers-as-mimics actually change their mimicked shapes periodically, but this doesn't do that. They'd probably change to non-mimic quicker than they'd mimic something else so it's not worth the effort. --- doc/fixes34.4 | 1 + src/mon.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 88e7ce4a2..97a7376c6 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -311,6 +311,7 @@ fireproof, non-rustable weapon would be revealed as fireproof by hitting a rust-causing target; ditto for fixed crysknife surviving choking while eating various foods (cockatrice egg, fortune cookie, wolfsbane, others) didn't carry through to those foods' side-effects +shapechangers who take on mimic or hider form will mimic or hide when feasible Platform- and/or Interface-Specific Fixes diff --git a/src/mon.c b/src/mon.c index d5103a162..ff02a58fa 100644 --- a/src/mon.c +++ b/src/mon.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mon.c 3.5 2007/01/12 */ +/* SCCS Id: @(#)mon.c 3.5 2007/02/08 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2395,7 +2395,7 @@ register struct monst *mtmp; { struct trap *t; - if((mtmp->cham >= LOW_PM) || mtmp->mcan || mtmp->m_ap_type || + if (mtmp->mcan || mtmp->m_ap_type || cansee(mtmp->mx, mtmp->my) || rn2(3) || (mtmp == u.ustuck) || /* can't hide while trapped except in pits */ (mtmp->mtrapped && (t = t_at(mtmp->mx, mtmp->my)) != 0 && @@ -2646,6 +2646,8 @@ boolean msg; /* "The oldmon turns into a newmon!" */ wormgone(mtmp); place_monster(mtmp, mtmp->mx, mtmp->my); } + if (mtmp->m_ap_type && mdat->mlet != S_MIMIC) + seemimic(mtmp); /* revert to normal monster */ /* (this code used to try to adjust the monster's health based on a normal one of its type but there are too many special cases