]> granicus.if.org Git - nethack/commitdiff
fix #H4317 - grave diggin'
authorPatR <rankin@nethack.org>
Mon, 25 Apr 2016 07:14:48 +0000 (00:14 -0700)
committerPatR <rankin@nethack.org>
Mon, 25 Apr 2016 07:14:48 +0000 (00:14 -0700)
Digging a grave witha a pick-axe converted the grave to floor but
did not dig a pit and unearth the grave's contents.  [Caused by a
change to maketrap() intended to prevent wizard-mode wishing for
traps on top of furniture.]  Digging a second time succeeded in
creating a pit since the location was no longer furniture.

doc/fixes36.1
src/trap.c

index cbdc5bfe2b98f668187460409ecee9d3a49d9089..9cac7662799cae83acb6a3b78c3e51bb32358261 100644 (file)
@@ -220,6 +220,8 @@ automatic annotation for Ft.Ludios level got applied when a drawbridge became
        mapped, but entry there is a secret door rather than a drawbridge
 sortloot changed to group holy water and unholy water with water instead of
        placing them among the h- and u-named items
+digging down on a grave converted the terrain to floor but did not create a
+       pit and uncover the grave's contents; digging again--on floor--did
 
 post-3.6.0: fix "object lost" panic during pickup caused by sortloot revamp
 post-3.6.0: more sortloot revisions
index 1e7b88b4d551d54912bb7e1a6642972c336110bb..cf2e7d43c9e77b8fb29403f8cf3d9f87c9286904 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 trap.c  $NHDT-Date: 1461090580 2016/04/19 18:29:40 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.266 $ */
+/* NetHack 3.6 trap.c  $NHDT-Date: 1461568321 2016/04/25 07:12:01 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.268 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -311,12 +311,12 @@ struct monst *victim;
 
 struct trap *
 maketrap(x, y, typ)
-register int x, y, typ;
+int x, y, typ;
 {
     static union vlaunchinfo zero_vl;
-    register struct trap *ttmp;
-    register struct rm *lev;
     boolean oldplace;
+    struct trap *ttmp;
+    struct rm *lev = &levl[x][y];
 
     if ((ttmp = t_at(x, y)) != 0) {
         if (ttmp->ttyp == MAGIC_PORTAL || ttmp->ttyp == VIBRATING_SQUARE)
@@ -329,7 +329,8 @@ register int x, y, typ;
                     && typ != SPIKED_PIT)))
             u.utrap = 0;
         /* old <tx,ty> remain valid */
-    } else if (IS_FURNITURE(levl[x][y].typ)) {
+    } else if (IS_FURNITURE(lev->typ)
+               && (!IS_GRAVE(lev->typ) || (typ != PIT && typ != HOLE))) {
         /* no trap on top of furniture (caller usually screens the
            location to inhibit this, but wizard mode wishing doesn't) */
         return (struct trap *) 0;
@@ -401,7 +402,6 @@ register int x, y, typ;
         /*FALLTHRU*/
     case HOLE:
     case TRAPDOOR:
-        lev = &levl[x][y];
         if (*in_rooms(x, y, SHOPBASE)
             && (typ == HOLE || typ == TRAPDOOR
                 || IS_DOOR(lev->typ) || IS_WALL(lev->typ)))