From: nethack.rankin Date: Sat, 17 Aug 2002 10:24:35 +0000 (+0000) Subject: rolling boulder hitting pit which holds monster X-Git-Tag: MOVE2GIT~2513 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=096b42088917d7de7f4b7015ad03339047452367;p=nethack rolling boulder hitting pit which holds monster From a bug report, a rolling boulder trap could report that the boulder had fallen into the pit with you and then let it keep rolling. flooreffects() only returns true when it uses up the object being manipulated but it doesn't use up boulders that hit pits which hold monsters or the hero. Its caller needs to handle the cases where the boulder ends up sharing the pit with a monster. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index abbbf68ce..8a38da350 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -207,6 +207,7 @@ zero entries in DUNGEON, MONSTERS, et al, of config file are now treated as preserving the default rather than being ignored enlightenment: don't misreport polymorphed lycanthrope as "in beast form" remove TIMED_DELAY from the features checked for version compatibility +rolling boulder hitting monster stuck in pit should stop even when mon survives Platform- and/or Interface-Specific Fixes diff --git a/src/trap.c b/src/trap.c index 5962ce5a2..250380d63 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)trap.c 3.4 2002/07/14 */ +/* SCCS Id: @(#)trap.c 3.4 2002/08/16 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1310,8 +1310,19 @@ int style; seetrap(t); used_up = TRUE; break; + case PIT: + case SPIKED_PIT: + case HOLE: + case TRAPDOOR: + /* the boulder won't be used up if there is a + monster in the trap; stop rolling anyway */ + x2 = bhitpos.x, y2 = bhitpos.y; /* stops here */ + if (flooreffects(singleobj, x2, y2, "fall")) + used_up = TRUE; + dist = -1; /* stop rolling immediately */ + break; } - if (used_up) break; + if (used_up || dist == -1) break; } if (flooreffects(singleobj, bhitpos.x, bhitpos.y, "fall")) { used_up = TRUE;