]> granicus.if.org Git - nethack/commitdiff
B09002 - killing monsters seen by infravision
authorcohrs <cohrs>
Mon, 26 Aug 2002 15:31:51 +0000 (15:31 +0000)
committercohrs <cohrs>
Mon, 26 Aug 2002 15:31:51 +0000 (15:31 +0000)
ohitmon was incorrectly using location visibility in a couple places where
monster visibility was more appropriate.  I'm still not sure about the
canspotmon check for destroy vs killed.  Similar checks do no appear
elsewhere in the code.  But at least now the 'destroyed' won't be shown
for a seen, living monster.

src/mthrowu.c

index d0836c12d97c5c45f10379564a9fb82f7ddd02d3..4246a1f1d9b55f35efacd40b53258cf3cd5a3377 100644 (file)
@@ -186,7 +186,7 @@ boolean verbose;  /* give message(s) even when you can't see what happened */
            if (ismimic) seemimic(mtmp);
            mtmp->msleeping = 0;
            if (vis) hit(distant_name(otmp,mshot_xname), mtmp, exclam(damage));
-           else if (verbose) pline("It is hit%s", exclam(damage));
+           else if (verbose) pline("%s is hit%s", Monnam(mtmp), exclam(damage));
 
            if (otmp->opoisoned && is_poisonable(otmp)) {
                if (resists_poison(mtmp)) {
@@ -221,7 +221,7 @@ boolean verbose;  /* give message(s) even when you can't see what happened */
            if (mtmp->mhp < 1) {
                if (vis || verbose)
                    pline("%s is %s!", Monnam(mtmp),
-                       (nonliving(mtmp->data) || !vis)
+                       (nonliving(mtmp->data) || !canspotmon(mtmp))
                        ? "destroyed" : "killed");
                /* don't blame hero for unknown rolling boulder trap */
                if (!flags.mon_moving &&