]> granicus.if.org Git - nethack/commitdiff
Invisible monsters looking much better
authorcohrs <cohrs>
Tue, 27 Jan 2004 17:28:00 +0000 (17:28 +0000)
committercohrs <cohrs>
Tue, 27 Jan 2004 17:28:00 +0000 (17:28 +0000)
<Someone> reported back in December of an invisible monster using an amulet of
lifesaving and looking much better.  While the comment in the code says the
amulet is visible, this does not mean the monster is.  Add a secondary check.

doc/fixes34.4
src/mon.c

index 52f2e0eb1704c8683c0c0d55e68b4ef923670d63..a4ccd1680aa3ba435b76e89cd317e7d3969ba55d 100644 (file)
@@ -15,6 +15,7 @@ some actions such as eating corpses off the floor didn't check whether hero
        could reach the bottom of a pit
 usmellmon() instead of "It turns into it" during monster polymorph
 grammar of messages regarding eating artifacts
+avoid a message about an invisible monster looking much better
 
 
 Platform- and/or Interface-Specific Fixes
index 09b66811e71c4318f3fdd6ba47d4081c35d90229..2eea44bab9bd73fdf85b67fcff56519e2739caf0 100644 (file)
--- a/src/mon.c
+++ b/src/mon.c
@@ -1385,21 +1385,24 @@ struct monst *mtmp;
        struct obj *lifesave = mlifesaver(mtmp);
 
        if (lifesave) {
-               /* not canseemon; amulets are on the head, so you don't want */
-               /* to show this for a long worm with only a tail visible. */
-               /* Nor do you check invisibility, because glowing and disinte- */
-               /* grating amulets are always visible. */
+               /* not canseemon; amulets are on the head, so you don't want
+                * to show this for a long worm with only a tail visible.
+                * Nor do you check invisibility, because glowing and
+                * disintegrating amulets are always visible. */
                if (cansee(mtmp->mx, mtmp->my)) {
-                       pline("But wait...");
-                       pline("%s medallion begins to glow!",
-                               s_suffix(Monnam(mtmp)));
-                       makeknown(AMULET_OF_LIFE_SAVING);
+                   pline("But wait...");
+                   pline("%s medallion begins to glow!",
+                         s_suffix(Monnam(mtmp)));
+                   makeknown(AMULET_OF_LIFE_SAVING);
+                   /* amulet is visible, but monster might not be */
+                   if (canseemon(mtmp)) {
                        if (attacktype(mtmp->data, AT_EXPL)
                            || attacktype(mtmp->data, AT_BOOM))
-                               pline("%s reconstitutes!", Monnam(mtmp));
+                           pline("%s reconstitutes!", Monnam(mtmp));
                        else
-                               pline("%s looks much better!", Monnam(mtmp));
-                       pline_The("medallion crumbles to dust!");
+                           pline("%s looks much better!", Monnam(mtmp));
+                   }
+                   pline_The("medallion crumbles to dust!");
                }
                m_useup(mtmp, lifesave);
                mtmp->mcanmove = 1;