]> granicus.if.org Git - nethack/commitdiff
fix previous #332 fix
authorPatR <rankin@nethack.org>
Sun, 26 Apr 2020 02:17:46 +0000 (19:17 -0700)
committerPatR <rankin@nethack.org>
Sun, 26 Apr 2020 02:17:46 +0000 (19:17 -0700)
Add missing visibility check.

src/mhitm.c

index 26b5982988db170afdd244d43500232b6173af88..4e648d0c7fc2c7303627d00432affc5c11e2a043 100644 (file)
@@ -976,9 +976,11 @@ int dieroll;
                    now we'll know and might need to deliver skipped message
                    (note: if there's no message there'll be no auxilliary
                    damage so the message here isn't coming too late) */
-                if (!artifact_hit(magr, mdef, mwep, &tmp, dieroll))
-                    pline("%s hits %s.", Monnam(magr),
-                          mon_nam_too(mdef, magr));
+                if (!artifact_hit(magr, mdef, mwep, &tmp, dieroll)) {
+                    if (g.vis)
+                        pline("%s hits %s.", Monnam(magr),
+                              mon_nam_too(mdef, magr));
+                }
                 /* artifact_hit updates 'tmp' but doesn't inflict any
                    damage; however, it might cause carried items to be
                    destroyed and they might do so */