From 1afa961416325ce442a4e7060cb291b01c9b3031 Mon Sep 17 00:00:00 2001 From: PatR Date: Tue, 12 May 2020 15:26:28 -0700 Subject: [PATCH] fix github issue #343 - scattered objects landing on water or lava without being affected. Reported for exploding bag of holding but has been a latent issue for scatter() for ages. Fixes #343 --- doc/fixes37.0 | 4 +++- src/explode.c | 8 +++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 853158aac..4a7270b47 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.208 $ $NHDT-Date: 1588189422 2020/04/29 19:43:42 $ +$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.217 $ $NHDT-Date: 1589322383 2020/05/12 22:26:23 $ General Fixes and Modified Features ----------------------------------- @@ -177,6 +177,8 @@ after "double trouble", cloned Wizard would wait until he had suffered some beyond turn 100000, prayer timeout is longer (scaling with game length) falling while going down stairs and dropping items due to encumbrance or punishment wasn't subject fragile ones to breakage +objects scattered by an explosion which land on water or lava weren't affected + by the water or lava Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/explode.c b/src/explode.c index 38e6cdf8d..c44baa261 100644 --- a/src/explode.c +++ b/src/explode.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 explode.c $NHDT-Date: 1545182146 2018/12/19 01:15:46 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.60 $ */ +/* NetHack 3.6 explode.c $NHDT-Date: 1589322381 2020/05/12 22:26:21 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.70 $ */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -764,8 +764,10 @@ struct obj *obj; /* only scatter this obj */ if (stmp->obj) { if (x != sx || y != sy) total += stmp->obj->quan; - place_object(stmp->obj, x, y); - stackobj(stmp->obj); + if (!flooreffects(stmp->obj, x, y, "land")) { + place_object(stmp->obj, x, y); + stackobj(stmp->obj); + } } free((genericptr_t) stmp); newsym(x, y);