summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ng-init.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-05-02 16:13:47 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-05-02 16:13:47 +0200
commit3f28b40b721229c8b41747cf61ee0166b390a4c7 (patch)
treea6631e42ae0293f2fc376d85463d2eabb023852c /crawl-ref/source/ng-init.cc
parent9207632cc69cdc68b5e672a1af9e6b662feaad81 (diff)
downloadcrawl-ref-3f28b40b721229c8b41747cf61ee0166b390a4c7.tar.gz
crawl-ref-3f28b40b721229c8b41747cf61ee0166b390a4c7.zip
Get rid of a hack for setting Sprint's dungeon length.
brdepth[] is loaded before any actual levels, and this way, multi-level sprints are possible.
Diffstat (limited to 'crawl-ref/source/ng-init.cc')
-rw-r--r--crawl-ref/source/ng-init.cc49
1 files changed, 22 insertions, 27 deletions
diff --git a/crawl-ref/source/ng-init.cc b/crawl-ref/source/ng-init.cc
index c4f485d87c..ba87b9ef5a 100644
--- a/crawl-ref/source/ng-init.cc
+++ b/crawl-ref/source/ng-init.cc
@@ -45,32 +45,6 @@ static uint8_t _random_potion_description()
return desc;
}
-void initialise_branches_for_game_type()
-{
- if (crawl_state.game_is_sprint())
- {
- brdepth.init(-1);
- brdepth[BRANCH_MAIN_DUNGEON] = 1;
- brdepth[BRANCH_ABYSS] = 1;
- return;
- }
-
- if (crawl_state.game_is_zotdef())
- {
- brdepth.init(-1);
- brdepth[BRANCH_MAIN_DUNGEON] = 1;
- brdepth[BRANCH_BAZAAR] = 1;
- return;
- }
-
- for (int i = 0; i < NUM_BRANCHES; i++)
- brdepth[i] = branches[i].numlevels;
-
- // In trunk builds, test variable-length branches.
- if (numcmp(Version::Long().c_str(), "0.11-b") == -1)
- brdepth[BRANCH_ELVEN_HALLS] = random_range(3, 4);
-}
-
// Determine starting depths of branches.
void initialise_branch_depths()
{
@@ -105,7 +79,28 @@ void initialise_branch_depths()
startdepth[disabled_branch[i]] = -1;
}
- initialise_branches_for_game_type();
+ if (crawl_state.game_is_sprint())
+ {
+ brdepth.init(-1);
+ brdepth[BRANCH_MAIN_DUNGEON] = 1;
+ brdepth[BRANCH_ABYSS] = 1;
+ return;
+ }
+
+ if (crawl_state.game_is_zotdef())
+ {
+ brdepth.init(-1);
+ brdepth[BRANCH_MAIN_DUNGEON] = 1;
+ brdepth[BRANCH_BAZAAR] = 1;
+ return;
+ }
+
+ for (int i = 0; i < NUM_BRANCHES; i++)
+ brdepth[i] = branches[i].numlevels;
+
+ // In trunk builds, test variable-length branches.
+ if (numcmp(Version::Long().c_str(), "0.11-b") == -1)
+ brdepth[BRANCH_ELVEN_HALLS] = random_range(3, 4);
}
#define MAX_OVERFLOW_LEVEL 9