From 07f60f407c953cf9c5bd2c5aa48d57d80501eea9 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Wed, 23 Apr 2008 02:35:38 +0000 Subject: [1949314] Fixing another issue with stairs not being properly marked as having been visited. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4502 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/tile1.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'crawl-ref/source/tile1.cc') diff --git a/crawl-ref/source/tile1.cc b/crawl-ref/source/tile1.cc index a5cf5f2e72..25259f1b38 100644 --- a/crawl-ref/source/tile1.cc +++ b/crawl-ref/source/tile1.cc @@ -49,6 +49,26 @@ void TileNewLevel(bool first_time) tile_clear_buf(); if (first_time) tile_init_flavor(); + + // Fix up stair markers. The travel information isn't hooked up + // until after we change levels. So, look through all of the stairs + // on this level and check if they still need the stair flag. + for (unsigned int x = 0; x < GXM; x++) + for (unsigned int y = 0; y < GYM; y++) + { + unsigned int tile = env.tile_bk_bg[x][y]; + if (!(tile & TILE_FLAG_NEW_STAIR)) + continue; + + const coord_def gc(x,y); + int object = grd(gc); + + if (!is_travelable_stair((dungeon_feature_type)object) || + travel_cache.know_stair(gc)) + { + env.tile_bk_bg[x][y] &= ~TILE_FLAG_NEW_STAIR; + } + } } /**** tile index routines ****/ -- cgit v1.2.3-54-g00ecf