Fix mention_map and hiders causing a light source error

Prevent glyph change messages while loading a level file.
Otherwise a monster hiding under an item triggered a vision recalc
before light sources were linked to their sources, leading into
strange errors looking like pointer corruption.

getlev -> hide_monst -> hideunder -> newsym -> show_glyph ->
 pline_xy -> vision_recalc -> do_light_sources -> get_obj_location

Add in_getlev program state variable, analogous to in_mklev
This commit is contained in:
Pasi Kallinen
2024-04-17 23:42:37 +03:00
parent 064523e162
commit 7db8f7c6a5
4 changed files with 6 additions and 1 deletions

View File

@@ -1950,6 +1950,7 @@ show_glyph(coordxy x, coordxy y, int glyph)
if (a11y.glyph_updates && !a11y.mon_notices_blocked
&& !gp.program_state.in_docrt
&& !gp.program_state.in_getlev
&& (oldglyph != glyph || gg.gbuf[y][x].gnew)) {
int c = glyph_to_cmap(glyph);
if ((glyph_is_nothing(oldglyph) || glyph_is_unexplored(oldglyph)