From 7ab2bb967ac34a602eb0afdb48f08e0fd134a99c Mon Sep 17 00:00:00 2001 From: cohrs Date: Tue, 27 Jan 2004 17:28:00 +0000 Subject: [PATCH] Invisible monsters looking much better 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 | 1 + src/mon.c | 25 ++++++++++++++----------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index 52f2e0eb1..a4ccd1680 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -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 diff --git a/src/mon.c b/src/mon.c index 09b66811e..2eea44bab 100644 --- 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;