diff options
author | Adam Borowski <kilobyte@angband.pl> | 2013-12-19 00:19:24 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2013-12-19 00:19:24 +0100 |
commit | f933c8c3d6a141c76ca5e05eda5f11b6d14722c3 (patch) | |
tree | 80d1922fbb3977ddfdc79678544a5a29f879f894 /crawl-ref/source/wiz-dgn.cc | |
parent | 56402a27013be84ab7678cbfc1725d380fdaf04e (diff) | |
download | crawl-ref-f933c8c3d6a141c76ca5e05eda5f11b6d14722c3.tar.gz crawl-ref-f933c8c3d6a141c76ca5e05eda5f11b6d14722c3.zip |
Schedule DNGN_ENTER_PORTAL_VAULT for removal; other related fixes.
Diffstat (limited to 'crawl-ref/source/wiz-dgn.cc')
-rw-r--r-- | crawl-ref/source/wiz-dgn.cc | 98 |
1 files changed, 40 insertions, 58 deletions
diff --git a/crawl-ref/source/wiz-dgn.cc b/crawl-ref/source/wiz-dgn.cc index 4b42398fe7..8d65b455be 100644 --- a/crawl-ref/source/wiz-dgn.cc +++ b/crawl-ref/source/wiz-dgn.cc @@ -44,75 +44,57 @@ #ifdef WIZARD static dungeon_feature_type _find_appropriate_stairs(bool down) { - if (player_in_connected_branch() || player_in_branch(BRANCH_ABYSS)) - { - int depth = you.depth; + if (you.where_are_you == BRANCH_PANDEMONIUM) if (down) - depth++; + return DNGN_TRANSIT_PANDEMONIUM; else - depth--; + return DNGN_EXIT_PANDEMONIUM; - // Can't go down from bottom level of a branch. - if (depth > brdepth[you.where_are_you]) - { - mpr("Can't go down from the bottom of a branch."); - return DNGN_UNSEEN; - } - // Going up from top level of branch - else if (depth == 0) - { - // Special cases - if (player_in_branch(BRANCH_VESTIBULE)) - return DNGN_EXIT_HELL; - else if (player_in_branch(BRANCH_ABYSS)) - return DNGN_EXIT_ABYSS; - else if (player_in_branch(BRANCH_DUNGEON)) - return DNGN_STONE_STAIRS_UP_I; - - dungeon_feature_type stairs = your_branch().exit_stairs; - - if (stairs < DNGN_RETURN_FROM_FIRST_BRANCH - || stairs > DNGN_RETURN_FROM_LAST_BRANCH) - { - mpr("This branch has no exit stairs defined."); - return DNGN_UNSEEN; - } - return stairs; - } - // Branch non-edge cases - else if (depth >= 1) - { - if (down) - return DNGN_STONE_STAIRS_DOWN_I; - else - return DNGN_ESCAPE_HATCH_UP; - } - else + int depth = you.depth; + if (down) + depth++; + else + depth--; + + // Can't go down from bottom level of a branch. + if (depth > brdepth[you.where_are_you]) + { + mpr("Can't go down from the bottom of a branch."); + return DNGN_UNSEEN; + } + // Going up from top level of branch + else if (depth == 0) + { + // Special cases + if (player_in_branch(BRANCH_VESTIBULE)) + return DNGN_EXIT_HELL; + else if (player_in_branch(BRANCH_ABYSS)) + return DNGN_EXIT_ABYSS; + else if (player_in_branch(BRANCH_DUNGEON)) + return DNGN_STONE_STAIRS_UP_I; + + dungeon_feature_type stairs = your_branch().exit_stairs; + + if (stairs < DNGN_RETURN_FROM_FIRST_BRANCH + || stairs > DNGN_RETURN_FROM_LAST_BRANCH) { - mpr("Bug in determining level exit."); + mpr("This branch has no exit stairs defined."); return DNGN_UNSEEN; } + return stairs; } - - switch (you.where_are_you) + // Branch non-edge cases + else if (depth >= 1) { - case BRANCH_LABYRINTH: if (down) - { - mpr("Can't go down in the Labyrinth."); - return DNGN_UNSEEN; - } + return DNGN_STONE_STAIRS_DOWN_I; else return DNGN_ESCAPE_HATCH_UP; - - case BRANCH_PANDEMONIUM: - if (down) - return DNGN_TRANSIT_PANDEMONIUM; - else - return DNGN_EXIT_PANDEMONIUM; - - default: - return DNGN_EXIT_PORTAL_VAULT; + } + else + { + mpr("Bug in determining level exit."); + return DNGN_UNSEEN; } } |