summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tile1.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-23 02:35:38 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-04-23 02:35:38 +0000
commit07f60f407c953cf9c5bd2c5aa48d57d80501eea9 (patch)
tree031e7b4c062e4469217d81c8357739642a947598 /crawl-ref/source/tile1.cc
parent81876c70a7f81134cf0b1ecb35cec07800718508 (diff)
downloadcrawl-ref-07f60f407c953cf9c5bd2c5aa48d57d80501eea9.tar.gz
crawl-ref-07f60f407c953cf9c5bd2c5aa48d57d80501eea9.zip
[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
Diffstat (limited to 'crawl-ref/source/tile1.cc')
-rw-r--r--crawl-ref/source/tile1.cc20
1 files changed, 20 insertions, 0 deletions
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 ****/