diff --git a/doc/fixes37.0 b/doc/fixes37.0 index 06439c04e..44ecccd08 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.164 $ $NHDT-Date: 1586179508 2020/04/06 13:25:08 $ +$NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.168 $ $NHDT-Date: 1586285681 2020/04/07 18:54:41 $ General Fixes and Modified Features ----------------------------------- @@ -118,6 +118,10 @@ pets avoid eating shapeshifter corpses unless starving or nearly feral blessed scroll of teleportation gives a single controlled teleport allow opening a tin without interruption if slimed tell player when wielding a different weapon toggles off dual-wielding +object taking erosion damage might give feedback message when out of view + or not give such when in view, depending on stale value of 'bhitpos' + [cited case assumed message came from drowned monster's dropped + inventory when out-of-view ice melted] Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/do.c b/src/do.c index 65bec769c..ce57fb802 100644 --- a/src/do.c +++ b/src/do.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 do.c $NHDT-Date: 1582155879 2020/02/19 23:44:39 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.228 $ */ +/* NetHack 3.6 do.c $NHDT-Date: 1586285681 2020/04/07 18:54:41 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.235 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Derek S. Ray, 2015. */ /* NetHack may be freely redistributed. See license for details. */ @@ -144,6 +144,8 @@ const char *verb; /* make sure things like water_damage() have no pointers to follow */ obj->nobj = obj->nexthere = (struct obj *) 0; + /* erode_obj() needs this (called from water_damage() or lava_damage()) */ + g.bhitpos.x = x, g.bhitpos.y = y; if (obj->otyp == BOULDER && boulder_hits_pool(obj, x, y, FALSE)) { return TRUE; diff --git a/src/trap.c b/src/trap.c index 84587a0fd..948d814d3 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* NetHack 3.6 trap.c $NHDT-Date: 1582799195 2020/02/27 10:26:35 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.353 $ */ +/* NetHack 3.6 trap.c $NHDT-Date: 1586285683 2020/04/07 18:54:43 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.357 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2013. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3424,6 +3424,10 @@ xchar x, y; struct obj *obj, *nobj; int num = 0; + /* erode_obj() relies on bhitpos if target objects aren't carried by + the hero or a monster, to check visibility controlling feedback */ + g.bhitpos.x = x, g.bhitpos.y = y; + for (obj = chain; obj; obj = nobj) { nobj = here ? obj->nexthere : obj->nobj; if (fire_damage(obj, force, x, y)) @@ -3676,12 +3680,18 @@ struct obj *obj; boolean here; { struct obj *otmp; + xchar x, y; /* initialize acid context: so far, neither seen (dknown) potions of acid nor unseen have exploded during this water damage sequence */ g.acid_ctx.dkn_boom = g.acid_ctx.unk_boom = 0; g.acid_ctx.ctx_valid = TRUE; + /* erode_obj() relies on bhitpos if target objects aren't carried by + the hero or a monster, to check visibility controlling feedback */ + if (get_obj_location(obj, &x, &y, CONTAINED_TOO)) + g.bhitpos.x = x, g.bhitpos.y = y; + for (; obj; obj = otmp) { otmp = here ? obj->nexthere : obj->nobj; water_damage(obj, (char *) 0, FALSE);