From 9d28a8dc764832a66f0a4da15f2d86dc94519b2b Mon Sep 17 00:00:00 2001 From: Michael Meyer Date: Fri, 29 Jul 2022 12:52:16 -0400 Subject: [PATCH] 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. --- src/display.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/display.c b/src/display.c index 89a644656..dcf1726c1 100644 --- a/src/display.c +++ b/src/display.c @@ -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))