summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/stairs.cc
diff options
context:
space:
mode:
authorNeil Moore <neil@s-z.org>2013-11-12 21:02:54 -0500
committerNeil Moore <neil@s-z.org>2013-11-12 21:06:08 -0500
commit06343e30e0d7455fd4468fa0b8f5dace3ab57dd8 (patch)
tree07f6fb0fbcc08bf2e5dc78005d70bc2f7cd8d2a8 /crawl-ref/source/stairs.cc
parente5e675a5d20e11a313e685b9a22f9bc643b52258 (diff)
downloadcrawl-ref-06343e30e0d7455fd4468fa0b8f5dace3ab57dd8.tar.gz
crawl-ref-06343e30e0d7455fd4468fa0b8f5dace3ab57dd8.zip
Use default parents for nonexistent branches.
If we don't per-game brentry data, make parent_branch return what would be the parent, rather than NUM_BRANCHES. Among other things, this avoids leaking random branch choices in the ctrl-o screen (branches not in the current game were never listed). Also revert two piecemeal fixes that are now handled by the more general code: This reverts commit 259fcac8a0cba227ee4dc49cf5a7d5d2718cdc9c. This reverts commit 81f5e101725dc1c0d5e96fc068a7b2b8d72b12ba.
Diffstat (limited to 'crawl-ref/source/stairs.cc')
-rw-r--r--crawl-ref/source/stairs.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/crawl-ref/source/stairs.cc b/crawl-ref/source/stairs.cc
index 8e936fadd1..20f99b030d 100644
--- a/crawl-ref/source/stairs.cc
+++ b/crawl-ref/source/stairs.cc
@@ -502,8 +502,7 @@ level_id stair_destination(dungeon_feature_type feat, const string &dst,
{
if (feat == DNGN_ESCAPE_HATCH_UP)
feat = DNGN_EXIT_PORTAL_VAULT; // silly Labyrinths
- else if (parent_branch(you.where_are_you) < NUM_BRANCHES
- || branches[you.where_are_you].parent_branch < NUM_BRANCHES)
+ else if (parent_branch(you.where_are_you) < NUM_BRANCHES)
{
level_id lev = brentry[you.where_are_you];
if (!lev.is_valid())