From a355911c2c98c5dba8428046b4033c820b46998c Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 24 Mar 2015 22:07:16 -0400 Subject: [PATCH] no hiding under nothing On 3/23/2015 6:41 PM, a bug reporter wrote: > When you're hiding under an item (e.g. via garter snake polyform), and > that item gets polyshuddered into nonexistence, you continue hiding > (under nothing). This addresses the "hiding under nothing" bug, but does not address this flavor comment also included in the report: > (Incidentally, it's a bit weird that you use > to aim at items that are > flavorwise above you at the time.) --- doc/fixes35.0 | 2 ++ src/zap.c | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 34a6ac9b4..f22cdc80d 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -881,6 +881,8 @@ message inconsistency: death message "swallowed whole" was preceded improve the messaging when a monster you can't see is causing an obstruction add option mention_walls, which gives feedback when bumping against a wall fix invalid pointer dereference in morguemon if ndemon returns NON_PM +after object loss through polyshudder don't get left hiding under nothing + if you're polymorphed into a hider Platform- and/or Interface-Specific Fixes diff --git a/src/zap.c b/src/zap.c index 3134c8b88..fcf0047bf 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* NetHack 3.5 zap.c $NHDT-Date: 1426465444 2015/03/16 00:24:04 $ $NHDT-Branch: debug $:$NHDT-Revision: 1.195 $ */ +/* NetHack 3.5 zap.c $NHDT-Date: 1427249230 2015/03/25 02:07:10 $ $NHDT-Branch: master $:$NHDT-Revision: 1.197 $ */ /* NetHack 3.5 zap.c $Date: 2013/11/05 00:57:56 $ $Revision: 1.183 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1750,8 +1750,14 @@ struct obj *obj, *otmp; if (Is_box(obj)) (void) boxlock(obj, otmp); if (obj_shudders(obj)) { + boolean cover = ((obj->ox == u.ux && obj->oy == u.uy) && + u.uundetected && + hides_under(youmonst.data)); + if (cansee(obj->ox, obj->oy)) learn_it = TRUE; do_osshock(obj); + /* eek - your cover might have been blown */ + if (cover) (void) hideunder(&youmonst); break; } obj = poly_obj(obj, STRANGE_OBJECT); -- 2.50.1