]> granicus.if.org Git - nethack/commitdiff
digging holes
authornethack.rankin <nethack.rankin>
Thu, 10 Mar 2005 05:18:28 +0000 (05:18 +0000)
committernethack.rankin <nethack.rankin>
Thu, 10 Mar 2005 05:18:28 +0000 (05:18 +0000)
     If you manage to escape a hole and then dig down with a pick-axe at
that location, finish on the first move instead of after the usual N turns.

doc/fixes34.4
src/dig.c

index bb2d3e1277d217711e32e4d44a4cdada776c0cb5..104cfe351f65ea80a01d48229b7dba484a7eae38 100644 (file)
@@ -92,6 +92,7 @@ monkeys can't steal rings worn under cursed weapon
 succubi will remove hero's gloves before taking worn ring; incubi will do
        so before forcing ring to be put on
 mbodypart should return forehoof, not foreclaw, for horselike monsters
+further digging of an existing hole finishes in a single turn
 
 
 Platform- and/or Interface-Specific Fixes
index 407c77fb6508bd3adcc43c464a92a02d0d778055..0608d0998d11020aaccc3fcb35b8b878ece1f4ca 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)dig.c      3.5     2003/03/23      */
+/*     SCCS Id: @(#)dig.c      3.5     2005/03/07      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -270,9 +270,10 @@ dig()
        if (Race_if(PM_DWARF))
            context.digging.effort *= 2;
        if (context.digging.down) {
-               register struct trap *ttmp;
+               struct trap *ttmp = t_at(dpx, dpy);
 
-               if (context.digging.effort > 250) {
+               if (context.digging.effort > 250 ||
+                       (ttmp && ttmp->ttyp == HOLE)) {
                    (void) dighole(FALSE);
                    (void) memset((genericptr_t)&context.digging, 0,
                                        sizeof (struct dig_info));
@@ -280,9 +281,8 @@ dig()
                }
 
                if (context.digging.effort <= 50 ||
-                   ((ttmp = t_at(dpx,dpy)) != 0 &&
-                       (ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT ||
-                        ttmp->ttyp == TRAPDOOR || ttmp->ttyp == HOLE)))
+                       (ttmp && (ttmp->ttyp == TRAPDOOR ||
+                           ttmp->ttyp == PIT || ttmp->ttyp == SPIKED_PIT)))
                    return(1);
 
                if (IS_ALTAR(lev->typ)) {