|
From: <gi...@cr...> - 2026-01-29 19:45:14
|
via f2d9c54bfe284783b7c22debd09c1b833fd10851 (commit)
from 264ef1ee839f281b1efd8a78e6d17da17ed41195 (commit)
-----------------------------------------------------------------------
commit f2d9c54bfe284783b7c22debd09c1b833fd10851
Author: DracoOmega <dra...@gm...>
Date: Thu Jan 29 16:09:14 2026 -0330
Fix an obscure parchment rendering crash (Odds, Rypofalem)
When drawing map cells, in certain cases the cached foreground tile wasn't
being reset - for instance, if there was a staircase with items on it,
tile_draw_map_cell would add the item marker to that cells while otherwise
leaving the tile ID alone.
This could cause a crash in the specific circumstance where there was a
parchment on a previous floor at the same position as a corpse on top of a
stair or hatch on the new floor. The code to pick the proper tile for a
parchment would still think there was a parchment there, and then would
treat that corpse as if it were this parchment and often result in an
assert (since both monster type and parchment spell were encoded as
item_def.plus and monster enums can greatly excede the valid range for
spell enums). Unlike many such crashes, this one was possible on both local
tiles and webtiles.
-----------------------------------------------------------------------
Summary of changes:
crawl-ref/source/tileview.cc | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/crawl-ref/source/tileview.cc b/crawl-ref/source/tileview.cc
index 55194fa814..671db11f66 100644
--- a/crawl-ref/source/tileview.cc
+++ b/crawl-ref/source/tileview.cc
@@ -1090,6 +1090,7 @@ void tile_draw_map_cell(const coord_def& gc, bool foreground_only)
const map_cell& cell = env.map_knowledge(gc);
+ tile_env.bk_fg(gc) = 0;
if (cell.invisible_monster())
_tile_place_invisible_monster(gc);
else if (cell.monsterinfo())
@@ -1101,8 +1102,6 @@ void tile_draw_map_cell(const coord_def& gc, bool foreground_only)
else
_tile_place_item(gc, *cell.item(), (cell.flags & MAP_MORE_ITEMS) != 0);
}
- else
- tile_env.bk_fg(gc) = 0;
// Always place clouds now they have their own layer
if (cell.cloud() != CLOUD_NONE)
--
Dungeon Crawl Stone Soup
|