]> granicus.if.org Git - nethack/commitdiff
untrapping traps in unreachable locations
authorcohrs <cohrs>
Wed, 6 Feb 2002 05:39:43 +0000 (05:39 +0000)
committercohrs <cohrs>
Wed, 6 Feb 2002 05:39:43 +0000 (05:39 +0000)
don't allow untrapping of an adjacent trap you cannot reach by movement

doc/fixes34.0
src/trap.c

index 18bb37c6d6ffe8e43d2c3f158bbe8a36d5cd34a2..bbdee78ef5f23fc8a83b072c8b6742b674a9f0ff 100644 (file)
@@ -419,6 +419,7 @@ if player teleports a monster while swallowed on a noteleport level, the
 prefixes that can appear in any order when wishing should include +/- and empty
 word-order in wishes, allow "blessed +2 fireproof", not just 
        "blessed fireproof +2"
+don't allow untrapping of adjacent traps in locations you can't move to
 
 
 Platform- and/or Interface-Specific Fixes
index e9b8e46bbe8b28426970f5d10d5ae1b01861ffd2..b097a180c9d8fecad038173d01c0d3785dc3f83f 100644 (file)
@@ -2782,6 +2782,18 @@ boolean force_failure;
                There("is a boulder in your way.");
                return 0;
        }
+       /* duplicate tight-space checks from test_move */
+       if (u.dx && u.dy &&
+           bad_rock(youmonst.data,u.ux,ttmp->ty) &&
+           bad_rock(youmonst.data,ttmp->tx,u.uy)) {
+           if ((invent && (inv_weight() + weight_cap() > 600)) ||
+               bigmonst(youmonst.data)) {
+               /* don't allow untrap if they can't get thru to it */
+               You("are unable to reach the %s!",
+                   defsyms[trap_to_defsym(ttype)].explanation);
+               return 0;
+           }
+       }
        /* untrappable traps are located on the ground. */
        if (!can_reach_floor()) {
 #ifdef STEED