Fix dark room glyphs when searching

Searching while blind showed room glyphs as lit even when
dark_room option was on.
This commit is contained in:
Pasi Kallinen
2015-04-19 10:47:05 +03:00
parent 7ba63a868a
commit 460538b618
+13 -8
View File
@@ -564,15 +564,17 @@ feel_location(x, y)
if (lev->typ != ROOM && lev->seenv) { if (lev->typ != ROOM && lev->seenv) {
map_background(x, y, 1); map_background(x, y, 1);
} else { } else {
lev->glyph = lev->waslit ? cmap_to_glyph(S_room) : lev->glyph = flags.dark_room ? cmap_to_glyph(S_darkroom) :
cmap_to_glyph(S_stone); (lev->waslit ? cmap_to_glyph(S_room) :
cmap_to_glyph(S_stone));
show_glyph(x,y,lev->glyph); show_glyph(x,y,lev->glyph);
} }
} else if ((lev->glyph >= cmap_to_glyph(S_stone) && } else if ((lev->glyph >= cmap_to_glyph(S_stone) &&
lev->glyph < cmap_to_glyph(S_room)) || lev->glyph < cmap_to_glyph(S_darkroom)) ||
glyph_is_invisible(levl[x][y].glyph)) { glyph_is_invisible(levl[x][y].glyph)) {
lev->glyph = lev->waslit ? cmap_to_glyph(S_room) : lev->glyph = flags.dark_room ? cmap_to_glyph(S_darkroom) :
cmap_to_glyph(S_stone); (lev->waslit ? cmap_to_glyph(S_room) :
cmap_to_glyph(S_stone));
show_glyph(x,y,lev->glyph); show_glyph(x,y,lev->glyph);
} }
} else { } else {
@@ -583,6 +585,9 @@ feel_location(x, y)
if (lev->typ == CORR && if (lev->typ == CORR &&
lev->glyph == cmap_to_glyph(S_litcorr) && !lev->waslit) lev->glyph == cmap_to_glyph(S_litcorr) && !lev->waslit)
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr)); show_glyph(x, y, lev->glyph = cmap_to_glyph(S_corr));
else if (lev->typ == ROOM && flags.dark_room &&
lev->glyph == cmap_to_glyph(S_room))
show_glyph(x, y, lev->glyph = cmap_to_glyph(S_darkroom));
} }
} else { } else {
_map_location(x, y, 1); _map_location(x, y, 1);
@@ -610,9 +615,9 @@ feel_location(x, y)
} }
/* Floor spaces are dark if unlit. Corridors are dark if unlit. */ /* Floor spaces are dark if unlit. Corridors are dark if unlit. */
if (lev->typ == ROOM && if (lev->typ == ROOM && lev->glyph == cmap_to_glyph(S_room) &&
lev->glyph == cmap_to_glyph(S_room) && !lev->waslit) (!lev->waslit || flags.dark_room))
show_glyph(x,y, lev->glyph = cmap_to_glyph(S_stone)); show_glyph(x,y, lev->glyph = cmap_to_glyph(flags.dark_room ? S_darkroom : S_stone));
else if (lev->typ == CORR && else if (lev->typ == CORR &&
lev->glyph == cmap_to_glyph(S_litcorr) && !lev->waslit) lev->glyph == cmap_to_glyph(S_litcorr) && !lev->waslit)
show_glyph(x,y, lev->glyph = cmap_to_glyph(S_corr)); show_glyph(x,y, lev->glyph = cmap_to_glyph(S_corr));