]> granicus.if.org Git - nethack/commitdiff
make corpse visible if stethoscope told you about it
authornhmall <mjnh@persona.ca>
Fri, 18 Dec 2015 23:24:13 +0000 (18:24 -0500)
committernhmall <mjnh@persona.ca>
Fri, 18 Dec 2015 23:24:13 +0000 (18:24 -0500)
Bug bz14, no web id.

Steps to reproduce:
- have a stethoscope handy.
- place an amulet in a doorway and move one square outside the room's door.
- create and lead an invisible stalker to be on top of amulet, with you
  just outside the room beside the door square.
- zap the stalker asleep with a wand of sleep.
- put on a blindfold.
- quaff a potion of object detection.
- amulet shows in the doorway.
- save the game and keep the savefile for ease of returning to this point.

Bug 1 observed (remember that you're blind due to blindfold):
- zap a wand of death at the stalker that you know to be on top of
the amulet, but that the game gives no indication of.
- if the stalker left a corpse, and you apply a stethoscope to the
  doorway, the game tells you that "You determine that that unfortunate
  being is dead" yet no being or corpse is displayed, still just the amulet.

Fix that by calling map_object(corpse, TRUE) in its_dead() under these circumstances.

The circumstances in the original report were also reproduced, specifically:
If a stethoscope finds an unseen monster on a square with an
object-detected object while blind, after killing the monster, the
object isn't remembered.

That remains unfixed because the I (invis monster glyph) aleady overwrote the
detected object glyph, so it is a much tougher situation.

src/apply.c

index 22cef7f5a09e0c9bf9f484e3dbd74ae4da00bbe5..96c77386cae57fc53dc66cca740e88f9457c91a1 100644 (file)
@@ -1,4 +1,4 @@
-/* NetHack 3.6 apply.c $NHDT-Date: 1446808436 2015/11/06 11:13:56 $  $NHDT-Branch: master $:$NHDT-Revision: 1.210 $ */
+/* NetHack 3.6 apply.c $NHDT-Date: 1450481050 2015/12/18 23:24:10 $  $NHDT-Branch: NetHack-3.6.0 $:$NHDT-Revision: 1.214 $ */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -237,6 +237,13 @@ int rx, ry, *resp;
     } else if (corpse) {
         boolean here = (rx == u.ux && ry == u.uy),
                 one = (corpse->quan == 1L && !more_corpses), reviver = FALSE;
+        int visglyph, corpseglyph;
+
+        visglyph = glyph_at(rx, ry);
+        corpseglyph = obj_to_glyph(corpse);
+
+        if (Blind && (visglyph != corpseglyph))
+            map_object(corpse, TRUE);
 
         if (Role_if(PM_HEALER)) {
             /* ok to reset `corpse' here; we're done with it */