summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/travel.cc
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-11 15:59:32 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-11 15:59:32 +0000
commite8be657dec0c9e239fb072053d59f8ce6a34fdb5 (patch)
tree6f3b68a169ce202335ddb06daaa940b1456c061c /crawl-ref/source/travel.cc
parent42a287ebc7f5cd9b483966c1419c3020036c342d (diff)
downloadcrawl-ref-e8be657dec0c9e239fb072053d59f8ce6a34fdb5.tar.gz
crawl-ref-e8be657dec0c9e239fb072053d59f8ce6a34fdb5.zip
[2013519] Fixing auto-travel problems. There were two issues here. One was that going up stairs wasn't updating the correct stair on the previous level. Secondly, sync_branch_stairs was destroying that update anyway. Added a "clear_branch_stairs" function to clear stair info when leaving the vestibule. I am nearly sure this should fix all of the hellish travel issues, but it probably deserves some testing.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6500 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/travel.cc')
-rw-r--r--crawl-ref/source/travel.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/crawl-ref/source/travel.cc b/crawl-ref/source/travel.cc
index e8fbe6dc2b..680c66f191 100644
--- a/crawl-ref/source/travel.cc
+++ b/crawl-ref/source/travel.cc
@@ -3185,6 +3185,21 @@ void LevelInfo::sync_branch_stairs(const stair_info *si)
}
}
+void LevelInfo::clear_stairs(dungeon_feature_type grid)
+{
+ for (int i = 0, size = stairs.size(); i < size; ++i)
+ {
+ stair_info &si = stairs[i];
+ if (si.grid != grid)
+ continue;
+
+ si.destination.id.depth = -1;
+ si.destination.pos.x = -1;
+ si.destination.pos.y = -1;
+ si.guessed_pos = true;
+ }
+}
+
stair_info *LevelInfo::get_stair(int x, int y)
{
const coord_def c(x, y);