]> granicus.if.org Git - nethack/commitdiff
fix #M107 - blindness and secret doors
authornethack.rankin <nethack.rankin>
Thu, 16 Jun 2005 03:37:25 +0000 (03:37 +0000)
committernethack.rankin <nethack.rankin>
Thu, 16 Jun 2005 03:37:25 +0000 (03:37 +0000)
     From a bug report:  zapping force
bolt broke an adjacent potion of blindness (possibly carried by the monster
he was attacking) which caused "it suddently gets dark" but further course
of the bolt resulted in now blinded hero recieving "a door appears in the
wall".  make_blinded() was deferring vision recalculation until next pass
through moveloop() (or until next pline()--if the "gets dark" message had
been delivered after the call to make_blinded() instead of before, this
wouldn't have been noticeable).  Fix is trivial:  just recalculate vision
immediately when temporary blindness is toggled.  [It might also be needed
for involuntary blindfold removal, although I suspect that that is always
accompanied by corresponding pline() which gets vision back into synch.]

doc/fixes34.4
src/potion.c
src/vision.c

index 00a14057f1cc2e6ed55588c86ad189d8eecefcae..2e45e750e1a9334d5447850e3bbff0adb1697600 100644 (file)
@@ -126,6 +126,7 @@ chatting with quest leader who was brought back from the dead gave warnings
 becoming green slime or mimicking gold violates "never changed form" conduct
 when a monster grew into a higher form which had previously been genocided,
        the message explaining its fate was only given if it was sensed via ESP
+hero could still see for brief period after being blinded by potion vapors
 
 
 Platform- and/or Interface-Specific Fixes
index f376c1f7af1704c6deff0524fa711eab1ab0814c..f36852c756b61a174b6b81b21b1ab693f85f74f9 100644 (file)
@@ -243,6 +243,13 @@ boolean talk;
        if (u_could_see ^ can_see_now) {  /* one or the other but not both */
            context.botl = 1;
            vision_full_recalc = 1;     /* blindness just got toggled */
+           /* this vision recalculation used to be deferred until
+              moveloop(), but that made it possible for vision
+              irregularities to occur (cited case was force bolt
+              hitting adjacent potion of blindness and then a
+              secret door; hero was blinded by vapors but then
+              got the message "a door appears in the wall") */
+           vision_recalc(0);
            if (Blind_telepat || Infravision) see_monsters();
        }
 }
index 28f63c06fa9ad346ca542d279bd9ca7d9db68ada..0bc5fc06fa60aac8f8bf5e84667f15d254a126c1 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)vision.c   3.5     1999/02/18      */
+/*     SCCS Id: @(#)vision.c   3.5     2005/06/15      */
 /* Copyright (c) Dean Luick, with acknowledgements to Dave Cohrs, 1990.        */
 /* NetHack may be freely redistributed.  See license for details.      */
 
@@ -468,6 +468,8 @@ new_angle(lev, sv, row, col)
  *     + Right before something is printed. [pline()]
  *     + Right before we do a vision based operation. [do_clear_area()]
  *     + screen redraw, so we can renew all positions in sight. [docrt()]
+ *     + When toggling temporary blindness, in case additional events
+ *       impacted by vision occur during the same move [make_blinded()]
  *
  * Control flag = 1.  An adjacent vision recalculation.  The hero has moved
  * one square.  Knowing this, it might be possible to optimize the vision