]> granicus.if.org Git - nethack/commitdiff
no hiding under nothing
authornhmall <mjnh@persona.ca>
Wed, 25 Mar 2015 02:07:16 +0000 (22:07 -0400)
committernhmall <mjnh@persona.ca>
Wed, 25 Mar 2015 02:07:16 +0000 (22:07 -0400)
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
src/zap.c

index 34a6ac9b47b8637f2d00c752104c9355ec5ff4f5..f22cdc80d18572356d456c24852cc1d95a0e6131 100644 (file)
@@ -881,6 +881,8 @@ message inconsistency: death message "swallowed <mon> 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
index 3134c8b889a7f08a41fc263cb70c1edb289fc9b8..fcf0047bfb309b4d4e63d1cca12968aaffc7277f 100644 (file)
--- 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);