]> granicus.if.org Git - nethack/commitdiff
fix #H2797 - avoid "vision clears" if hero can't see
authorPatR <rankin@nethack.org>
Tue, 27 Jul 2021 19:29:46 +0000 (12:29 -0700)
committerPatR <rankin@nethack.org>
Tue, 27 Jul 2021 19:29:46 +0000 (12:29 -0700)
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.

doc/fixes37.0
src/sit.c

index ffabdd7caf52895fd9a493736221ffebd9df8785..b535ea9c16db39b26790b0c0fb07c0085b2666fd 100644 (file)
@@ -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
index ac22bbbe4e345f502093fd316292d4dc25f5ecec..0ca44dcc7dfe253f51369660db139cc8ea151cb8 100644 (file)
--- 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);
                 }