]> granicus.if.org Git - nethack/commitdiff
buglist: autodig
authornethack.allison <nethack.allison>
Mon, 15 Sep 2003 03:49:28 +0000 (03:49 +0000)
committernethack.allison <nethack.allison>
Mon, 15 Sep 2003 03:49:28 +0000 (03:49 +0000)
> Would it be possible to make autodig also dig downward
> when I press '>' while wielding an pick-axe? When digging for gold,
> after casting detect objects, this would be convenient for getting
> to buried gold and gems.
> [<Someone>]

doc/fixes34.3
src/do.c

index e459b02d87ff4abc35a4c828858144bd2475dc60..27dab1b01adb4145ac07f94f0b85ca86fb600bea 100644 (file)
@@ -36,6 +36,7 @@ win32gui: you couldn't specify an alignment in defaults.nh and have it stick
 General New Features
 --------------------
 bones file compatibility info is now written into the dat/options file
+extend autodig to work downwards via '>'
 
 
 Platform- and/or Interface-Specific New Features
index 939356cf44429f8c4ef13f5f154db602ebc58da6..4b07de7cf929d36d012754ed5bee3f7aca2973ca 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -760,8 +760,14 @@ dodown()
                if (!(trap = t_at(u.ux,u.uy)) ||
                        (trap->ttyp != TRAPDOOR && trap->ttyp != HOLE)
                        || !Can_fall_thru(&u.uz) || !trap->tseen) {
-                       You_cant("go down here.");
-                       return(0);
+
+                       if (flags.autodig && !flags.nopick &&
+                               uwep && is_pick(uwep)) {
+                               return use_pick_axe2(uwep);
+                       } else {
+                               You_cant("go down here.");
+                               return(0);
+                       }
                }
        }
        if(u.ustuck) {