From 1574c6effd9f9b630fa496239c00077a4693a0b6 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sun, 27 Aug 2006 02:09:39 +0000 Subject: [PATCH] fix #H179 - blinding attack while fainted 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 | 1 + src/mondata.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/fixes34.4 b/doc/fixes34.4 index ec6e902f5..fb5b3d6a2 100644 --- a/doc/fixes34.4 +++ b/doc/fixes34.4 @@ -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 diff --git a/src/mondata.c b/src/mondata.c index c651b36c8..77040b2a9 100644 --- a/src/mondata.c +++ b/src/mondata.c @@ -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 */ -- 2.40.0