diff options
author | Zannick <jokeserver@gmail.com> | 2013-08-07 00:25:11 -0700 |
---|---|---|
committer | Neil Moore <neil@s-z.org> | 2013-08-09 23:18:20 -0400 |
commit | c1edc7049bdfb53d6350f46e92508abdc72de4c2 (patch) | |
tree | 7c9cb5dbe17859e8b188e8d129426721e53001e9 /crawl-ref/source/maps.cc | |
parent | 38856ef5bb664b4276ca7661b16266ac3a775073 (diff) | |
download | crawl-ref-c1edc7049bdfb53d6350f46e92508abdc72de4c2.tar.gz crawl-ref-c1edc7049bdfb53d6350f46e92508abdc72de4c2.zip |
Clear the subvault stack on each placement attempt
This fixes a rare corner case (#7435) where a vault's subvaults could be
placed correctly while the vault itself is not, causing the builder to
fail to place its subvaults on subsequent attempts.
Also add a debug message for when the validate lua call fails.
Diffstat (limited to 'crawl-ref/source/maps.cc')
-rw-r--r-- | crawl-ref/source/maps.cc | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc index d1b192e40e..0eebfd02ea 100644 --- a/crawl-ref/source/maps.cc +++ b/crawl-ref/source/maps.cc @@ -118,9 +118,6 @@ 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. - clear_subvault_stack(); - mdef.load(); // Copy the map so we can monkey with it. @@ -134,6 +131,9 @@ static map_section_type _write_vault(map_def &mdef, while (tries-- > 0) { + // We're a regular vault, so clear the subvault stack. + clear_subvault_stack(); + if (place.map.test_lua_veto()) break; @@ -189,7 +189,10 @@ static bool _resolve_map_lua(map_def &map) } if (!map.test_lua_validate(false)) + { + dprf("Lua validation for map %s failed.", map.name.c_str()); return false; + } return true; } |