From e379b245d4ebd613957a1ddf1124d892041c0cb0 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sun, 2 Jan 2011 01:35:14 +0000 Subject: [PATCH] fix #H2154 - unlocking door blocked by mimic-as-boulder (trunk only) Reported five months ago by , the top level of Sokoban has mimics who pose as boulders and if one was in a doorway (treasure zoo at final destination) you could still unlock the door there without waking the mimic. Yesterday's fix for unlocking a door which was actually a mimic posing as one didn't handle this case. --- doc/fixes35.0 | 2 ++ src/lock.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 153584242..9ea39a681 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -342,6 +342,8 @@ when reading an unknown scroll and learning it, discovery of teleporation was too late if hero happened to land on another scroll of teleportation using an unlocking tool on a closed door which was actually a mimic reported that there was no door to unlock instead of exposing the mimic +using an unlocking tool on a boulder that was a mimic in a Sokoban doorway + successfully unlocked the underlying door without exposing mimic Platform- and/or Interface-Specific Fixes diff --git a/src/lock.c b/src/lock.c index 0fce4639c..60fb4e8c1 100644 --- a/src/lock.c +++ b/src/lock.c @@ -407,6 +407,17 @@ pick_lock(pick) /* "The door actually was a !" */ stumble_onto_mimic(mtmp); return PICKLOCK_LEARNED_SOMETHING; + /* mimic-as-boulder on last Sokoban level */ + } else if (mtmp && mtmp->m_ap_type == M_AP_OBJECT && + mtmp->mappearance == BOULDER) { + if (Blind) /* by touch */ + /* "Wait! That's a monster!" */ + stumble_onto_mimic(mtmp); + else if (IS_DOOR(door->typ)) + pline("That door is blocked."); + else + You("see no door there."); + return PICKLOCK_LEARNED_SOMETHING; } if(!IS_DOOR(door->typ)) { if (is_drawbridge_wall(cc.x,cc.y) >= 0)