summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/maps.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-10-15 18:23:37 +0200
committerAdam Borowski <kilobyte@angband.pl>2012-10-15 18:32:50 +0200
commit24f731f88627020b36748b59dd9a4da7118f5f25 (patch)
treeab8865b273119797a7c5aedc46566c633e418847 /crawl-ref/source/maps.cc
parenta8e8e54d37581717a8010cdedd86fa9ea3481741 (diff)
downloadcrawl-ref-24f731f88627020b36748b59dd9a4da7118f5f25.tar.gz
crawl-ref-24f731f88627020b36748b59dd9a4da7118f5f25.zip
Fix subvault give-back not working properly on failures of the host vault.
Subvaults were registered as used the moment SUBVAULT clause resolved, without a way to undo that registration (except for the whole level being vetoed). The host vault was then properly given back, possibly resulting in the subvault being exhausted if it had no allow_dup.
Diffstat (limited to 'crawl-ref/source/maps.cc')
-rw-r--r--crawl-ref/source/maps.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index 1b018ad5e7..59182af001 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -105,6 +105,10 @@ static map_section_type _write_vault(map_def &mdef,
vault_placement &place,
bool check_place)
{
+ // We're a regular vault, so clear the subvault stack.
+ env.new_subvault_names.clear();
+ env.new_subvault_tags.clear();
+
mdef.load();
// Copy the map so we can monkey with it.