]> granicus.if.org Git - nethack/commitdiff
fix #H2154 - unlocking door blocked by mimic-as-boulder (trunk only)
authornethack.rankin <nethack.rankin>
Sun, 2 Jan 2011 01:35:14 +0000 (01:35 +0000)
committernethack.rankin <nethack.rankin>
Sun, 2 Jan 2011 01:35:14 +0000 (01:35 +0000)
     Reported five months ago by <email deleted>,
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
src/lock.c

index 15358424202b101bc6b55f561e64c68d1ea5afa2..9ea39a681bd794c67336270a70cb6ad0338b43f8 100644 (file)
@@ -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
index 0fce4639c200f2c1237e2f44d23e7837093e64be..60fb4e8c1940b32e64ee74d31918dae445191b80 100644 (file)
@@ -407,6 +407,17 @@ pick_lock(pick)
                /* "The door actually was a <mimic>!" */
                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)