summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-scan.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-06-21 13:45:12 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-06-21 13:52:51 +0200
commitedaffbec1d81643992dd2eb44cfe6097b995b2b3 (patch)
treefeeb70334a077f1677ca0b6efb26265df08dfb25 /crawl-ref/source/dbg-scan.cc
parent11135592c4f32fac7ebe14c504dfd27c00e77501 (diff)
downloadcrawl-ref-edaffbec1d81643992dd2eb44cfe6097b995b2b3.tar.gz
crawl-ref-edaffbec1d81643992dd2eb44cfe6097b995b2b3.zip
Assert that $BRANCH:1 always has an exit.
Diffstat (limited to 'crawl-ref/source/dbg-scan.cc')
-rw-r--r--crawl-ref/source/dbg-scan.cc32
1 files changed, 31 insertions, 1 deletions
diff --git a/crawl-ref/source/dbg-scan.cc b/crawl-ref/source/dbg-scan.cc
index 13d53a2e25..127f4b4424 100644
--- a/crawl-ref/source/dbg-scan.cc
+++ b/crawl-ref/source/dbg-scan.cc
@@ -8,6 +8,8 @@
#include "dbg-scan.h"
#include "artefact.h"
+#include "branch.h"
+#include "chardump.h"
#include "coord.h"
#include "coordit.h"
#include "dbg-util.h"
@@ -569,6 +571,16 @@ void check_map_validity()
portal = DNGN_ENTER_HELL;
}
+ dungeon_feature_type exit = DNGN_UNSEEN;
+ if (you.depth == 1 && you.where_are_you != root_branch)
+ exit = branches[you.where_are_you].exit_stairs;
+
+ // these may require you to look farther:
+ if (exit == DNGN_EXIT_PANDEMONIUM)
+ exit = DNGN_TRANSIT_PANDEMONIUM;
+ if (exit == DNGN_EXIT_ABYSS)
+ exit = DNGN_UNSEEN;
+
for (rectangle_iterator ri(0); ri; ++ri)
{
dungeon_feature_type feat = grd(*ri);
@@ -587,12 +599,30 @@ void check_map_validity()
if (!in_bounds(*ri))
ASSERT(feat_is_solid(feat));
+ if (env.level_map_mask(*ri) && MMT_MIMIC)
+ continue;
+ // no mimics below
+
if (feat == portal)
portal = DNGN_UNSEEN;
+ if (feat == exit)
+ exit = DNGN_UNSEEN;
}
if (portal)
- die("%s didn't get generated.", dungeon_feature_name(portal));
+ {
+#ifdef DEBUG_DIAGNOSTICS
+ dump_map("missing_portal.map", true);
+#endif
+ die("Portal %s[%d] didn't get generated.", dungeon_feature_name(portal), portal);
+ }
+ if (exit)
+ {
+#ifdef DEBUG_DIAGNOSTICS
+ dump_map("missing_exit.map", true);
+#endif
+ die("Exit %s[%d] didn't get generated.", dungeon_feature_name(exit), exit);
+ }
// And just for good measure:
debug_item_scan();