diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-12 02:10:52 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-12 02:12:51 -0800 |
commit | 99dd2c330e26980704721fa037201f1f7fc8cb0f (patch) | |
tree | 1b9831d0ef32dcbf0b62e7d1754320669182587a /crawl-ref/source/dungeon.cc | |
parent | 087b6279a027eba362d0d3227b6cc5abdac78443 (diff) | |
download | crawl-ref-99dd2c330e26980704721fa037201f1f7fc8cb0f.tar.gz crawl-ref-99dd2c330e26980704721fa037201f1f7fc8cb0f.zip |
Use specialized single-altar overflow temples
For overflow temples with a single altar, look for a map tagged with
"temple_overflow_GODNAME" and use that if available.
Diffstat (limited to 'crawl-ref/source/dungeon.cc')
-rw-r--r-- | crawl-ref/source/dungeon.cc | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index 7623cd77b3..9ace2a865e 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -1694,15 +1694,39 @@ static void _build_overflow_temples(int level_number) } else { - std::string vault_tag = - make_stringf("temple_overflow_%d", num_gods); + std::string vault_tag; + + // For a single-altar temple, first try to find a temple specialized + // for that god. + if (num_gods == 1) + { + CrawlVector &god_vec = temple[TEMPLE_GODS_KEY]; + god_type god = (god_type) god_vec[0].get_byte(); + + vault_tag = make_stringf("temple_overflow_%s", + god_name(god).c_str()); + vault_tag = replace_all(vault_tag, " ", "_"); + lowercase(vault_tag); + + vault = random_map_for_tag(vault_tag, true); +#ifdef DEBUG_DIAGNOSTICS + if (vault == NULL) + mprf(MSGCH_DIAGNOSTICS, "Couldn't find overflow temple " + "for god %s", god_name(god).c_str()); +#endif + } - vault = random_map_for_tag(vault_tag, true); if (vault == NULL) { - mprf(MSGCH_ERROR, - "Couldn't find overflow temple tag '%s'!", - vault_tag.c_str()); + vault_tag = make_stringf("temple_overflow_%d", num_gods); + + vault = random_map_for_tag(vault_tag, true); + if (vault == NULL) + { + mprf(MSGCH_ERROR, + "Couldn't find overflow temple tag '%s'!", + vault_tag.c_str()); + } } } |