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
This commit is contained in:
PatR
2020-05-12 15:26:28 -07:00
parent 3165dd942e
commit 1afa961416
2 changed files with 8 additions and 4 deletions

View File

@@ -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

View File

@@ -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);