]> granicus.if.org Git - nethack/commitdiff
Fix mention_walls distinguishing unseen walls from solid stone
authorPasi Kallinen <paxed@alt.org>
Fri, 4 Feb 2022 12:02:15 +0000 (14:02 +0200)
committerPasi Kallinen <paxed@alt.org>
Fri, 4 Feb 2022 12:02:18 +0000 (14:02 +0200)
Bumping into an unseen wall reported "a wall" instead of "solid stone",
even though you could not know it was a wall when looking at it.

Use the same method when looking at glyphs on the map instead of
the map location type.

Fixes #318

doc/fixes3-7-0.txt
src/hack.c

index 4f218ce5f775301fa54f3d68a7d587bf0c3ba2e5..633922875f5541400fab3e46108b3356ee3f4ada 100644 (file)
@@ -765,6 +765,7 @@ falling down a hole or trapdoor will cause damage proportional to fall height
 stinking gas clouds block line-of-sight
 covetous monsters will teleport to downstairs or upstairs to heal
 have fake player monsters use verbalize instead of pline when reacting to chat
+fix mention_walls distinguishing unseen walls from solid stone
 
 
 Fixes to 3.7.0-x Problems that Were Exposed Via git Repository
index a01821f5d7a0a67a1ff360631cfc1185643dfb31..1e07ade0b77edfe2b1a11fc5d4cf784408db7e8c 100644 (file)
@@ -876,11 +876,20 @@ test_move(int ux, int uy, int dx, int dy, int mode)
                 else if (Passes_walls && !may_passwall(x, y)
                          && In_sokoban(&u.uz))
                     pline_The("Sokoban walls resist your ability.");
-                else if (flags.mention_walls)
-                    pline("It's %s.",
-                          (IS_WALL(tmpr->typ) || tmpr->typ == SDOOR) ? "a wall"
-                          : IS_TREE(tmpr->typ) ? "a tree"
-                          : "solid stone");
+                else if (flags.mention_walls) {
+                    char buf[BUFSZ];
+                    coord cc;
+                    int sym = 0;
+                    const char *firstmatch = 0;
+
+                    cc.x = x, cc.y = y;
+                    do_screen_description(cc, TRUE, sym, buf, &firstmatch, NULL);
+                    if (!strcmp(firstmatch, "stone"))
+                        Sprintf(buf, "solid stone");
+                    else
+                        Sprintf(buf, "%s", an(firstmatch));
+                    pline("It's %s.", buf);
+                }
             }
             return FALSE;
         }