summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-maps.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-03-10 23:20:19 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-03-11 14:25:27 +0100
commitf655073a526ccf4dc96507aa5b9352826cd10b51 (patch)
tree983a6365e81b680489d80a3c50ebb1d8d6e0d687 /crawl-ref/source/dbg-maps.cc
parentc64b59abd05ad16d950f179b4b964caa0f5ad068 (diff)
downloadcrawl-ref-f655073a526ccf4dc96507aa5b9352826cd10b51.tar.gz
crawl-ref-f655073a526ccf4dc96507aa5b9352826cd10b51.zip
Allow running --mapstat on only a selection of levels.
Diffstat (limited to 'crawl-ref/source/dbg-maps.cc')
-rw-r--r--crawl-ref/source/dbg-maps.cc14
1 files changed, 12 insertions, 2 deletions
diff --git a/crawl-ref/source/dbg-maps.cc b/crawl-ref/source/dbg-maps.cc
index 299cce5bd8..638e8bb98d 100644
--- a/crawl-ref/source/dbg-maps.cc
+++ b/crawl-ref/source/dbg-maps.cc
@@ -152,7 +152,12 @@ static vector<level_id> mg_dungeon_places()
const branch_type branch = static_cast<branch_type>(br);
for (int depth = 1; depth <= brdepth[br]; ++depth)
- places.push_back(level_id(branch, depth));
+ {
+ level_id l(branch, depth);
+ if (SysEnv.map_gen_range.get() && !SysEnv.map_gen_range->is_usable_in(l))
+ continue;
+ places.push_back(l);
+ }
}
return places;
}
@@ -274,6 +279,11 @@ static void _write_mapgen_stats()
for (int dep = 1; dep <= brdepth[i]; ++dep)
{
const level_id lid(br, dep);
+ if (SysEnv.map_gen_range.get()
+ && !SysEnv.map_gen_range->is_usable_in(lid))
+ {
+ continue;
+ }
_check_mapless(lid, mapless);
}
}
@@ -324,7 +334,7 @@ static void _write_mapgen_stats()
}
}
- if (!unused_maps.empty())
+ if (!unused_maps.empty() && !SysEnv.map_gen_range.get())
{
fprintf(outf, "\n\nUnused maps:\n\n");
for (int i = 0, size = unused_maps.size(); i < size; ++i)