From: PatR Date: Mon, 25 Apr 2016 07:14:48 +0000 (-0700) Subject: fix #H4317 - grave diggin' X-Git-Tag: NetHack-3.6.1_RC01~809 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6a3d82ced6362208b8a33d3c7418587401342f89;p=nethack fix #H4317 - grave diggin' 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. --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index cbdc5bfe2..9cac76627 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 diff --git a/src/trap.c b/src/trap.c index 1e7b88b4d..cf2e7d43c 100644 --- a/src/trap.c +++ b/src/trap.c @@ -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 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)))