From: PatR Date: Tue, 27 Jul 2021 19:29:46 +0000 (-0700) Subject: fix #H2797 - avoid "vision clears" if hero can't see X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=068fa6c658cc85c130c24b60f7bc482323c277d6;p=nethack fix #H2797 - avoid "vision clears" if hero can't see From 8 years ago, sitting on a throne and getting the confers-see- invisible result gave "your vision becomes clear" message even when hero was blind (who stays blind at the time). Give an alternate message if hero is blind, with another alternate when the blindless is due to being poly'd into something without eyes. --- diff --git a/doc/fixes37.0 b/doc/fixes37.0 index ffabdd7ca..b535ea9c1 100644 --- a/doc/fixes37.0 +++ b/doc/fixes37.0 @@ -1,4 +1,4 @@ -NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.608 $ $NHDT-Date: 1627413528 2021/07/27 19:18:48 $ +NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.609 $ $NHDT-Date: 1627414178 2021/07/27 19:29:38 $ General Fixes and Modified Features ----------------------------------- @@ -575,6 +575,7 @@ remove special doinv key, functionality was equal to BIND=0:inventory some monsters should not have been scared of bugle playing monsters that drowned would never leave a corpse (holdover from decades ago when it wasn't possible to recover anything from a water location) +give alternate message if hero is blind when throne gives "your vision clears" Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/sit.c b/src/sit.c index ac22bbbe4..0ca44dcc7 100644 --- a/src/sit.c +++ b/src/sit.c @@ -1,4 +1,4 @@ -/* NetHack 3.7 sit.c $NHDT-Date: 1596498210 2020/08/03 23:43:30 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.70 $ */ +/* NetHack 3.7 sit.c $NHDT-Date: 1627414178 2021/07/27 19:29:38 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.73 $ */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /*-Copyright (c) Robert Patrick Rankin, 2012. */ /* NetHack may be freely redistributed. See license for details. */ @@ -245,7 +245,30 @@ dosit(void) do_mapping(); } } else { - Your("vision becomes clear."); + /* avoid "vision clears" if hero can't see */ + if (!Blind) { + Your("vision becomes clear."); + } else { + int num_of_eyes = eyecount(g.youmonst.data); + const char *eye = body_part(EYE); + + /* note: 1 eye case won't actually happen--can't + sit on throne when poly'd into always-levitating + floating eye and can't polymorph into Cyclops */ + switch (num_of_eyes) { /* 2, 1, or 0 */ + default: + case 2: /* more than 1 eye */ + eye = makeplural(eye); + /*FALLTHRU*/ + case 1: /* one eye (Cyclops, floating eye) */ + Your("%s %s...", eye, vtense(eye, "tingle")); + break; + case 0: /* no eyes */ + You("have a very strange feeling in your %s.", + body_part(HEAD)); + break; + } + } HSee_invisible |= FROMOUTSIDE; newsym(u.ux, u.uy); }