Fix mention_walls distinguishing unseen walls from solid stone
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
This commit is contained in:
19
src/hack.c
19
src/hack.c
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user