summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/maps.cc
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-25 15:22:27 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-04-25 15:22:27 +0000
commitf817284d0e2c5657fb883f57430ed888ed7ac248 (patch)
tree1ec33d3450ade91fb08b7e903efaef7481ede8d2 /crawl-ref/source/maps.cc
parente11f6ceb8c6fcd91d774303208ae1818428524db (diff)
downloadcrawl-ref-f817284d0e2c5657fb883f57430ed888ed7ac248.tar.gz
crawl-ref-f817284d0e2c5657fb883f57430ed888ed7ac248.zip
Branch entry vaults now respect DEPTH: declarations so you can put tough branch entries deeper.
Detect creatures no longer clears the level map of detected items. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1366 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/maps.cc')
-rw-r--r--crawl-ref/source/maps.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/crawl-ref/source/maps.cc b/crawl-ref/source/maps.cc
index 660778d67d..2193d9334c 100644
--- a/crawl-ref/source/maps.cc
+++ b/crawl-ref/source/maps.cc
@@ -309,14 +309,18 @@ int random_map_for_depth(int depth, bool want_minivault)
return (mapindex);
}
-int random_map_for_tag(const std::string &tag, bool want_minivault)
+int random_map_for_tag(const std::string &tag,
+ bool want_minivault,
+ bool check_depth)
{
int mapindex = -1;
int rollsize = 0;
for (unsigned i = 0, size = vdefs.size(); i < size; ++i)
{
- if (vdefs[i].has_tag(tag) && vdefs[i].is_minivault() == want_minivault)
+ if (vdefs[i].has_tag(tag) && vdefs[i].is_minivault() == want_minivault
+ && (!check_depth || !vdefs[i].depth.valid()
+ || vdefs[i].depth.contains(you.your_level)))
{
rollsize += vdefs[i].chance;