summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/misc.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/misc.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/misc.cc')
-rw-r--r--crawl-ref/source/misc.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index 7e23bd12e7..4dd1b21753 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -1623,6 +1623,8 @@ void up_stairs(dungeon_feature_type force_stair,
branches[you.where_are_you].longname);
}
+ int stair_x = you.x_pos, stair_y = you.y_pos;
+
#ifdef USE_TILE
const bool newlevel =
#endif
@@ -1677,8 +1679,6 @@ void up_stairs(dungeon_feature_type force_stair,
travel_cache.get_level_info(new_level_id);
new_level_info.update();
- int stair_x = you.x_pos, stair_y = you.y_pos;
-
// First we update the old level's stair.
level_pos lp;
lp.id = new_level_id;
@@ -1698,12 +1698,12 @@ void up_stairs(dungeon_feature_type force_stair,
if (new_level_id == BRANCH_MAIN_DUNGEON
&& old_level_id == BRANCH_VESTIBULE_OF_HELL)
{
- lp.id.depth = -1;
- lp.pos.x = lp.pos.y = -1;
- guess = true;
+ old_level_info.clear_stairs(DNGN_EXIT_HELL);
+ }
+ else
+ {
+ old_level_info.update_stair(stair_x, stair_y, lp, guess);
}
-
- old_level_info.update_stair(you.x_pos, you.y_pos, lp, guess);
// We *guess* that going up a staircase lands us on a downstair,
// and that we can descend that downstair and get back to where we