]> granicus.if.org Git - nethack/commitdiff
B01001 - locking/unlocking a door while in a pit
authorcohrs <cohrs>
Sun, 23 Mar 2003 20:22:00 +0000 (20:22 +0000)
committercohrs <cohrs>
Sun, 23 Mar 2003 20:22:00 +0000 (20:22 +0000)
Since you can't reach a door to open it while in a pit, it makes sense you
can't lock/unlock it either.

doc/fixes34.2
src/lock.c

index cff339e317cebcb5f3f64db61533021870ec9fe0..6f0ad3720f19087bd762665e1dfb6843987f65ce 100644 (file)
@@ -21,6 +21,7 @@ the age of a potion of oil from a bones file wasn't being handled correctly
 putting gold in a container on the shop floor wasn't credited the way
        gold already in the container when dropped was credited
 avoid integer division rounding error when calculating carrying capacity
+don't lock/unlock a door while in a pit, to be consistent with door opening
 
 
 Platform- and/or Interface-Specific Fixes
index d5d9981c2af4099de8e35373f3ffe8e288ee1e85..ebd0ee0a7c3dfce621ad01982de5f49859fde4fd 100644 (file)
@@ -353,6 +353,11 @@ pick_lock(pick) /* pick a lock with a given object */
        } else {                        /* pick the lock in a door */
            struct monst *mtmp;
 
+           if (u.utrap && u.utraptype == TT_PIT) {
+               You_cant("reach over the edge of the pit.");
+               return(0);
+           }
+
            door = &levl[cc.x][cc.y];
            if ((mtmp = m_at(cc.x, cc.y)) && canseemon(mtmp)
                        && mtmp->m_ap_type != M_AP_FURNITURE