diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-03-10 00:04:43 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-12-18 04:38:15 +0100 |
commit | 12ce0c095afaeaf45856f01be547750f3af500c9 (patch) | |
tree | 8f6d743ba1c2e5affcbb555c5552cc51e00c2390 /crawl-ref/source/stairs.cc | |
parent | ef46e71c1a4ec34d6ab90a6683621d5c24f20cec (diff) | |
download | crawl-ref-12ce0c095afaeaf45856f01be547750f3af500c9.tar.gz crawl-ref-12ce0c095afaeaf45856f01be547750f3af500c9.zip |
Make portal entrances and exits proper features on their own.
Overloading made it impossible to redefine them, assign colours, made it
hard to do stuff on C++ side, and stank of elderberries.
Diffstat (limited to 'crawl-ref/source/stairs.cc')
-rw-r--r-- | crawl-ref/source/stairs.cc | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/crawl-ref/source/stairs.cc b/crawl-ref/source/stairs.cc index 17baab785b..7a2c8d5177 100644 --- a/crawl-ref/source/stairs.cc +++ b/crawl-ref/source/stairs.cc @@ -495,11 +495,13 @@ level_id stair_destination(coord_def pos, bool for_real) level_id stair_destination(dungeon_feature_type feat, const string &dst, bool for_real) { +#if TAG_MAJOR_VERSION == 34 + if (feat == DNGN_ESCAPE_HATCH_UP && player_in_branch(BRANCH_LABYRINTH)) + feat = DNGN_EXIT_LABYRINTH; +#endif if (branches[you.where_are_you].exit_stairs == feat) { - if (feat == DNGN_ESCAPE_HATCH_UP) - feat = DNGN_EXIT_PORTAL_VAULT; // silly Labyrinths - else if (parent_branch(you.where_are_you) < NUM_BRANCHES) + if (parent_branch(you.where_are_you) < NUM_BRANCHES) { level_id lev = brentry[you.where_are_you]; if (!lev.is_valid()) @@ -516,6 +518,9 @@ level_id stair_destination(dungeon_feature_type feat, const string &dst, } } + if (feat >= DNGN_EXIT_FIRST_PORTAL && feat <= DNGN_EXIT_LAST_PORTAL) + feat = DNGN_EXIT_PANDEMONIUM; + switch (feat) { case DNGN_ESCAPE_HATCH_UP: @@ -849,7 +854,9 @@ void down_stairs(dungeon_feature_type force_stair, bool force_known_shaft) if (stair_find == DNGN_ENTER_LABYRINTH || stair_find == DNGN_ENTER_PORTAL_VAULT || stair_find == DNGN_ENTER_PANDEMONIUM - || stair_find == DNGN_ENTER_ABYSS) + || stair_find == DNGN_ENTER_ABYSS + || stair_find >= DNGN_ENTER_FIRST_PORTAL + && stair_find <= DNGN_ENTER_LAST_PORTAL) { you.level_stack.push_back(level_pos::current()); } |