]> granicus.if.org Git - nethack/commitdiff
Fix "x" and "a" when choosing map location
authorPasi Kallinen <paxed@alt.org>
Wed, 15 Apr 2020 04:15:37 +0000 (07:15 +0300)
committerPasi Kallinen <paxed@alt.org>
Wed, 15 Apr 2020 04:15:41 +0000 (07:15 +0300)
Recent(ish) change to split unexplored glyphs from solid wall glyphs
resulted in getloc commands to choose unexplored and interesting
locations not work correctly.

Fixes #323

src/do_name.c

index 131edf835e26717160a244899c123b4cfcaa3529..9f7228341f2a9693b7e89df37bd1428cfc686dea 100644 (file)
@@ -245,8 +245,7 @@ const void *b;
 
 #define IS_UNEXPLORED_LOC(x,y) \
     (isok((x), (y))                                     \
-     && glyph_is_cmap(levl[(x)][(y)].glyph)             \
-     && levl[(x)][(y)].glyph == GLYPH_UNEXPLORED        \
+     && glyph_is_unexplored(levl[(x)][(y)].glyph)   \
      && !levl[(x)][(y)].seenv)
 
 #define GLOC_SAME_AREA(x,y)                                     \
@@ -371,6 +370,7 @@ int x, y, gloc;
                     || glyph_to_cmap(glyph) == S_ndoor));
     case GLOC_EXPLORE:
         return (glyph_is_cmap(glyph)
+                && !glyph_is_nothing(glyph_to_cmap(glyph))
                 && (is_cmap_door(glyph_to_cmap(glyph))
                     || is_cmap_drawbridge(glyph_to_cmap(glyph))
                     || glyph_to_cmap(glyph) == S_ndoor
@@ -402,7 +402,9 @@ int x, y, gloc;
                      || glyph_to_cmap(glyph) == S_room
                      || glyph_to_cmap(glyph) == S_darkroom
                      || glyph_to_cmap(glyph) == S_corr
-                     || glyph_to_cmap(glyph) == S_litcorr));
+                     || glyph_to_cmap(glyph) == S_litcorr)
+                 || glyph_is_nothing(glyph)
+                 || glyph_is_unexplored(glyph));
     }
     /*NOTREACHED*/
     return FALSE;