]> granicus.if.org Git - nethack/commitdiff
digging land mines sequel (trunk only)
authornethack.rankin <nethack.rankin>
Sat, 22 Apr 2006 04:39:17 +0000 (04:39 +0000)
committernethack.rankin <nethack.rankin>
Sat, 22 Apr 2006 04:39:17 +0000 (04:39 +0000)
     Axes can't dig through the floor, but attempting to dig down with one
shouldn't just "scratch the floor" if there is an armed land mine present.
Have it set off a land mine or bear trap, in addition to the possibility
of chopping your way out of being stuck in a bear trap (a recent change).

src/dig.c

index 2f949923ece46a4a55aa8bccb654ae3ce178de09..44bcc7fcee511c7a262fd26949f12d1a2ac682ff 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -1108,8 +1108,10 @@ struct obj *obj;
                /* might escape trap and still be teetering at brink */
                if (!u.utrap) cant_reach_floor(u.ux, u.uy, FALSE, TRUE);
        } else if (!ispick &&
-                   /* can only dig down with an axe if stuck in a bear trap */
-                   (!trap || !u.utrap || u.utraptype != TT_BEARTRAP)) {
+                   /* can only dig down with an axe when doing so will
+                      trigger or disarm a trap here */
+                   (!trap || (trap->ttyp != LANDMINE &&
+                              trap->ttyp != BEAR_TRAP))) {
                pline("%s merely scratches the %s.",
                                Yobjnam2(obj, (char *)0), surface(u.ux,u.uy));
                u_wipe_engr(3);