From a5700805c661ae5fe60d447f85773fd04eacb569 Mon Sep 17 00:00:00 2001 From: PatR Date: Mon, 26 Aug 2024 14:37:46 -0700 Subject: [PATCH] fix obscure secret corridor bug magic_map_background() would overwrite remembered objects and traps. That meant discovery of secret corridors by secret door detection or ^E would forget embedded objects at their locations. --- doc/fixes3-7-0.txt | 4 ++++ src/display.c | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index 9b45266b4..cefca5ecd 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1460,6 +1460,10 @@ region expiration could report "the gas cloud around you dissipates" and also "you see a gas cloud dissipate" for the same cloud spot reduce shopkeeper's innate speed from 18 to 16 so that a hasted shopkeeper doesn't always get 2 moves per turn +when a secret corridor was discovered by wand of secret door detection or by + wizard mode ^E and converted into a regular corridor, if there was a + formerly embbered object at the spot, presence of the object would be + forgotten unless within range of a light source Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/display.c b/src/display.c index 349fb6056..fc4db6f7f 100644 --- a/src/display.c +++ b/src/display.c @@ -248,7 +248,7 @@ magic_map_background(coordxy x, coordxy y, int show) else if (lev->typ == CORR && glyph == cmap_to_glyph(S_litcorr)) glyph = cmap_to_glyph(S_corr); } - if (svl.level.flags.hero_memory) + if (svl.level.flags.hero_memory && glyph_is_cmap(lev->glyph)) lev->glyph = glyph; if (show) show_glyph(x, y, glyph); @@ -1120,6 +1120,8 @@ tether_glyph(coordxy x, coordxy y) * * DISP_BEAM - Display the given glyph at each location, but do not erase * any until the close call. + * DISP_ALL - Same as DISP_BEAM except glyph is shown at the specified + * spot even when that spot can't be seen. * DISP_TETHER - Display a tether glyph at each location, and the tethered * object at the farthest location, but do not erase any * until the return trip or close. @@ -1277,7 +1279,7 @@ flash_glyph_at(coordxy x, coordxy y, int tg, int rpt) rpt *= 2; /* two loop iterations per 'count' */ glyph[0] = tg; glyph[1] = (svl.level.flags.hero_memory) ? levl[x][y].glyph - : back_to_glyph(x, y); + : back_to_glyph(x, y); /* even iteration count (guaranteed) ends with glyph[1] showing; caller might want to override that, but no newsym() calls here in case caller has tinkered with location visibility */ @@ -1974,13 +1976,14 @@ show_glyph(coordxy x, coordxy y, int glyph) && !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) || is_cmap_furniture(c)) && !is_cmap_wall(c) && !is_cmap_room(c)) { if ((a11y.mon_notices && glyph_is_monster(glyph)) || (glyph_is_monster(oldglyph)) || u_at(x, y)) { - /* nothing */ + ; /* nothing */ } else { show_glyph_change = TRUE; }