Update lit corridor display if dark_room toggled

The dark_room option determines whether remembered but unseen waslit
corridor spaces are displayed with S_litcorr or not.  When it is
disabled, a remembered permanently-lit corridor spot will be shown
as "lit corridor" when out of sight.  When it is enabled,
corridors are only shown as lit if they are currently in view.

Toggling this option was not immediately refreshing how corridors on the
map were displayed: an unseen spot shown as a lit corridor because
dark_room was disabled would continue to be shown as a lit corridor
when it was toggled on, until the hero's memory was refreshed by
visiting the spot and then leaving.

Slightly extend the existing function for updating how room spaces are
displayed when dark_room is toggled so that it will update the glyph
used for unseen lit corridors in a similar way.
This commit is contained in:
Michael Meyer
2022-07-29 12:52:16 -04:00
committed by Pasi Kallinen
parent c2393344b7
commit 9d28a8dc76

View File

@@ -1606,6 +1606,16 @@ reglyph_darkroom(void)
for (y = 0; y < ROWNO; y++) {
struct rm *lev = &levl[x][y];
if (!flags.dark_room) {
if (lev->glyph == cmap_to_glyph(S_corr)
&& lev->waslit)
lev->glyph = cmap_to_glyph(S_litcorr);
} else {
if (lev->glyph == cmap_to_glyph(S_litcorr)
&& !cansee(x, y))
lev->glyph = cmap_to_glyph(S_corr);
}
if (!flags.dark_room || !iflags.use_color
|| Is_rogue_level(&u.uz)) {
if (lev->glyph == cmap_to_glyph(S_darkroom))