diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-12 02:08:24 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-12 02:12:51 -0800 |
commit | 087b6279a027eba362d0d3227b6cc5abdac78443 (patch) | |
tree | 080ed1b507d145685c10edbd18460f06b9737d62 /crawl-ref/source/dungeon.cc | |
parent | 7a9b9a3ade714675e04052339a36308588368311 (diff) | |
download | crawl-ref-087b6279a027eba362d0d3227b6cc5abdac78443.tar.gz crawl-ref-087b6279a027eba362d0d3227b6cc5abdac78443.zip |
Choose main temple at new-game time
Randomly choose the main temple map at new game time, and count the
altars in it to determine how many altars have to go into overflow
temples.
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 8e6b7367b6..7623cd77b3 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -2610,24 +2610,28 @@ static bool _place_portal_vault(int stair, const std::string &tag, int dlevel) static const map_def *_dgn_random_map_for_place(bool minivault) { - const map_def *vault = NULL; - if (!minivault && player_in_branch(BRANCH_ECUMENICAL_TEMPLE)) { - // Try to place a main Temple vault with the exact number - // of altars needed. - std::string tag - = make_stringf("temple_main_%lu", - _temple_altar_list.size()); - vault = random_map_for_tag(tag); + // Temple vault determined at new game tiem. + std::string name = you.props[TEMPLE_MAP_KEY]; + + // Tolerate this for a little while, for old games. + if (!name.empty()) + { + const map_def *vault = find_map_by_name(name); - if (vault != NULL) + if (vault == NULL) + { + end(1, false, "Unable to place Temple vault '%s'", + name.c_str()); + } return (vault); + } } const level_id lid = level_id::current(); - vault = random_map_for_place(lid, minivault); + const map_def *vault = random_map_for_place(lid, minivault); // Disallow entry vaults for tutorial (only complicates things). if (!vault |