]> granicus.if.org Git - nethack/commitdiff
fix #H179 - blinding attack while fainted
authornethack.rankin <nethack.rankin>
Sun, 27 Aug 2006 02:09:39 +0000 (02:09 +0000)
committernethack.rankin <nethack.rankin>
Sun, 27 Aug 2006 02:09:39 +0000 (02:09 +0000)
     From a bug report, being hit with a
yellow light explosion while fainted from lack of food caused blindness
but being hit while sleeping did not.  Make being in fainted state become
a protection against light-induced blindness.

doc/fixes34.4
src/mondata.c

index ec6e902f5ae2bbcb774c671add1aebc3df2331f8..fb5b3d6a2621c5f55e82227e443917a8c42dda9a 100644 (file)
@@ -251,6 +251,7 @@ don't place hero on top of monster when arriving on level which is so full
 have to see a divine gift in order to have it become a discovery
 honor the never-in-hell flag when selecting random monster type for corpses,
        eggs, figurines, and statues created in Gehennom
+hero is not subject to light-based blindness while fainted from hunger
 
 
 Platform- and/or Interface-Specific Fixes
index c651b36c8096485d97e731d475b4e46d7a102462..77040b2a9b12c611c6d255c198e9d94bf73c0010 100644 (file)
@@ -1,4 +1,4 @@
-/*     SCCS Id: @(#)mondata.c  3.5     2006/07/07      */
+/*     SCCS Id: @(#)mondata.c  3.5     2006/08/26      */
 /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
 /* NetHack may be freely redistributed.  See license for details. */
 
@@ -119,7 +119,7 @@ struct monst *mon;
        boolean is_you = (mon == &youmonst);
        struct obj *o;
 
-       if (is_you ? (Blind || u.usleep) :
+       if (is_you ? (Blind || u.usleep || is_fainted()) :
                (mon->mblinded || !mon->mcansee || !haseyes(ptr) ||
                    /* BUG: temporary sleep sets mfrozen, but since
                            paralysis does too, we can't check it */