From 45c785fc5a74ff3df82b88f01657f6b6ad50fc0b Mon Sep 17 00:00:00 2001 From: dshaligram Date: Tue, 18 Nov 2008 13:46:22 +0000 Subject: Portal vault and labyrinth exits will return to the point on the dungeon level where the entrance was. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@7470 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/files.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/files.cc') diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc index 792f541063..d2085cc678 100644 --- a/crawl-ref/source/files.cc +++ b/crawl-ref/source/files.cc @@ -820,7 +820,8 @@ static void _sanity_test_monster_inventory() } } -static void _place_player_on_stair(branch_type old_branch, +static void _place_player_on_stair(level_area_type old_level_type, + branch_type old_branch, int stair_taken) { bool find_first = true; @@ -849,6 +850,14 @@ static void _place_player_on_stair(branch_type old_branch, // The vestibule and labyrinth always start from this stair. stair_taken = DNGN_EXIT_HELL; } + else if (stair_taken == DNGN_EXIT_PORTAL_VAULT + || ((old_level_type == LEVEL_LABYRINTH + || old_level_type == LEVEL_PORTAL_VAULT) + && (stair_taken == DNGN_ESCAPE_HATCH_DOWN + || stair_taken == DNGN_ESCAPE_HATCH_UP))) + { + stair_taken = DNGN_EXIT_PORTAL_VAULT; + } else if (stair_taken >= DNGN_STONE_STAIRS_DOWN_I && stair_taken <= DNGN_ESCAPE_HATCH_DOWN) { @@ -885,10 +894,6 @@ static void _place_player_on_stair(branch_type old_branch, { stair_taken = DNGN_STONE_ARCH; } - else if (stair_taken == DNGN_EXIT_PORTAL_VAULT) - { - stair_taken = DNGN_ESCAPE_HATCH_DOWN; - } else if (stair_taken == DNGN_ENTER_LABYRINTH) { // dgn_find_nearby_stair uses special logic for labyrinths. @@ -1197,7 +1202,7 @@ bool load( dungeon_feature_type stair_taken, load_mode_type load_mode, { _clear_clouds(); if (you.level_type != LEVEL_ABYSS) - _place_player_on_stair(old_branch, stair_taken); + _place_player_on_stair(old_level_type, old_branch, stair_taken); else you.moveto(coord_def(45, 35)); // FIXME: should be abyss_center } -- cgit v1.2.3-54-g00ecf