]> granicus.if.org Git - nethack/commitdiff
autosearch while blind (trunk only)
authornethack.rankin <nethack.rankin>
Thu, 24 Nov 2011 00:13:24 +0000 (00:13 +0000)
committernethack.rankin <nethack.rankin>
Thu, 24 Nov 2011 00:13:24 +0000 (00:13 +0000)
     From a bug report, he was running blind while wielding scissors--
I mean Excalibur--and stopped for no apparent reason.  The autosearch
capability conferred by that artifact (also by ring of searching, or for
some roles or races once they reach a particular level) had found a secret
door and changed it into a normal door, but since he couldn't see at the
time his map display wasn't updated to show that.  This makes the map show
such things even if blind, and also gives a message that the search found
something.

doc/fixes35.0
src/detect.c

index 7ab3cab0423b8d08482bb100515d7591ff3a606c..2896757c93d1f55a3d70992954a4d07b8523c339 100644 (file)
@@ -396,6 +396,8 @@ on Plane of Water, restrict levitation and flying to air bubbles;
        elsewhere, restrict them such that they don't work inside solid rock
 wand/scroll/spell of light now hurts gremlins (lamp/candle light doesn't)
 ditto for hero in gremlin form (camera too)
+autosearch finds and transforms secret doors and corridors even while blind,
+       but it wasn't updating the map to show them unless the hero could see
 
 
 Platform- and/or Interface-Specific Fixes
index f20312c3a3b8e8efcbc8fd97a2fb9189a24e4314..3e6424bd2290efa60c028f355261789e26e07cb4 100644 (file)
@@ -1235,7 +1235,7 @@ struct trap *trap;
 
 int
 dosearch0(aflag)
-register int aflag;
+register int aflag;    /* intrinsic autosearch vs explicit searching */
 {
 #ifdef GCC_BUG
 /* some versions of gcc seriously muck up nested loops. if you get strange
@@ -1270,17 +1270,16 @@ register int aflag;
                        cvt_sdoor_to_door(&levl[x][y]); /* .typ = DOOR */
                        exercise(A_WIS, TRUE);
                        nomul(0);
-                       if (Blind && !aflag)
-                           feel_location(x,y); /* make sure it shows up */
-                       else
-                           newsym(x,y);
+                       feel_location(x, y);    /* make sure it shows up */
+                       You("find a hidden door.");
                    } else if(levl[x][y].typ == SCORR) {
                        if(rnl(7-fund)) continue;
                        levl[x][y].typ = CORR;
                        unblock_point(x,y);     /* vision */
                        exercise(A_WIS, TRUE);
                        nomul(0);
-                       newsym(x,y);
+                       feel_location(x, y);    /* make sure it shows up */
+                       You("find a hidden passage.");
                    } else {
                /* Be careful not to find anything in an SCORR or SDOOR */
                        if((mtmp = m_at(x, y)) && !aflag) {
@@ -1343,6 +1342,7 @@ register int aflag;
        return(1);
 }
 
+/* the 's' command -- explicit searching */
 int
 dosearch()
 {