From: cohrs Date: Wed, 6 Feb 2002 05:39:43 +0000 (+0000) Subject: untrapping traps in unreachable locations X-Git-Tag: MOVE2GIT~3245 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b277a17fb4725f54c0c1e199f7e8e1a90d50c5b1;p=nethack untrapping traps in unreachable locations don't allow untrapping of an adjacent trap you cannot reach by movement --- diff --git a/doc/fixes34.0 b/doc/fixes34.0 index 18bb37c6d..bbdee78ef 100644 --- a/doc/fixes34.0 +++ b/doc/fixes34.0 @@ -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 diff --git a/src/trap.c b/src/trap.c index e9b8e46bb..b097a180c 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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