]> granicus.if.org Git - nethack/commitdiff
Fix: 'Suddenly you cannot see it'
authorMichael Meyer <me@entrez.cc>
Fri, 3 Sep 2021 20:55:37 +0000 (16:55 -0400)
committerPatR <rankin@nethack.org>
Sat, 4 Sep 2021 21:21:41 +0000 (14:21 -0700)
Updates to m_dowear_type(worn.c) in 5a09a01a13 inadvertently reversed
the effect of an xor near the end of the function, causing it to go from
testing whether a monster's status as 'seen' or 'unseen' changed over
the course of the function to testing whether it remained the same.

As a result, whenever an unseen, invisible monster donned a piece of
armor anywhere on the map, the message 'suddenly you cannot see it'
would be printed.  Fix the xor so that it goes back to testing whether
visibility changed since the start of the function.

src/worn.c

index 0cd4fab2193777fe1370c40f8c6b2a278b20d051..a774b0b02ed28c3f2b359ef5853a3a6254395e9a 100644 (file)
@@ -727,7 +727,7 @@ m_dowear_type(struct monst *mon, long flag, boolean creation,
     }
     update_mon_intrinsics(mon, best, TRUE, creation);
     /* if couldn't see it but now can, or vice versa, */
-    if (!creation && (sawmon ^ !canseemon(mon))) {
+    if (!creation && (sawmon ^ canseemon(mon))) {
         if (mon->minvis && !See_invisible) {
             pline("Suddenly you cannot see %s.", nambuf);
             makeknown(best->otyp);