summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/files.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-18 13:46:22 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-11-18 13:46:22 +0000
commit45c785fc5a74ff3df82b88f01657f6b6ad50fc0b (patch)
tree6a2040caed600f8490f61e3ce3a618e41b392af1 /crawl-ref/source/files.cc
parent8c1ef076fff9a86f9f31613ab7c42bee0c56c882 (diff)
downloadcrawl-ref-45c785fc5a74ff3df82b88f01657f6b6ad50fc0b.tar.gz
crawl-ref-45c785fc5a74ff3df82b88f01657f6b6ad50fc0b.zip
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
Diffstat (limited to 'crawl-ref/source/files.cc')
-rw-r--r--crawl-ref/source/files.cc17
1 files changed, 11 insertions, 6 deletions
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
}