diff options
author | Steve Melenchuk <smelenchuk@gmail.com> | 2013-10-25 16:54:13 -0600 |
---|---|---|
committer | Steve Melenchuk <smelenchuk@gmail.com> | 2013-10-25 16:54:13 -0600 |
commit | 16e8c2b310d3e6f59301574ee506560d9d1790ad (patch) | |
tree | 08a1df0060d2dc8be3fc7d024638309978d0a8ef /crawl-ref/source/maps.cc | |
parent | 8d2b60c04934d6d5cf84a0da7a0b1aebb732fade (diff) | |
download | crawl-ref-16e8c2b310d3e6f59301574ee506560d9d1790ad.tar.gz crawl-ref-16e8c2b310d3e6f59301574ee506560d9d1790ad.zip |
Allow vaults to have "nolayout_" tags.
This functionality prohibits vaults from placing on specific layout
types. It's meant to be mutually exclusive with layout_ tags, but
there's nothing stopping you from having both on one vault (I don't
expect consistent behaviour from this, though).
Diffstat (limited to 'crawl-ref/source/maps.cc')
-rw-r--r-- | crawl-ref/source/maps.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc index 6fd2734ced..806b24fef6 100644 --- a/crawl-ref/source/maps.cc +++ b/crawl-ref/source/maps.cc @@ -649,17 +649,24 @@ static map_section_type _apply_vault_definition( static bool _map_matches_layout_type(const map_def &map) { - if (env.level_layout_types.empty() || !map.has_tag_prefix("layout_")) + bool permissive = false; + if (env.level_layout_types.empty() + || (!map.has_tag_prefix("layout_") + && !(permissive = map.has_tag_prefix("nolayout_")))) + { return true; + } for (string_set::const_iterator i = env.level_layout_types.begin(); i != env.level_layout_types.end(); ++i) { if (map.has_tag("layout_" + *i)) return true; + else if (map.has_tag("nolayout_" + *i)) + return false; } - return false; + return permissive; } static bool _map_matches_species(const map_def &map) |