summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-24 05:59:10 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-24 05:59:10 +0000
commitb1932b010b489debc3ccaef344e991279e5bf983 (patch)
treecc0a12c75e64f3a366dc6ed27ff0c464a88686ff /crawl-ref/source
parent282e620e20e26847f617b3c6a3deb5e7bab0c239 (diff)
downloadcrawl-ref-b1932b010b489debc3ccaef344e991279e5bf983.tar.gz
crawl-ref-b1932b010b489debc3ccaef344e991279e5bf983.zip
More checks for DEBUG_MONS_SCAN.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6660 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/debug.cc22
1 files changed, 21 insertions, 1 deletions
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 1a9d5fbef2..8773d08211 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -1977,6 +1977,7 @@ void debug_item_scan( void )
#if DEBUG_MONS_SCAN
void debug_mons_scan()
{
+ bool warned = false;
for (int y = 0; y < GYM; ++y)
for (int x = 0; x < GXM; ++x)
{
@@ -1985,10 +1986,29 @@ void debug_mons_scan()
menv[mons].pos() != coord_def(x, y))
{
const monsters *m = &menv[mons];
- mprf(MSGCH_WARN, "Bogosity: mgrd at %d,%d points at %s, but monster is at %d,%d",
+ mprf(MSGCH_WARN,
+ "Bogosity: mgrd at %d,%d points at %s, "
+ "but monster is at %d,%d",
x, y, m->name(DESC_PLAIN).c_str(), m->x, m->y);
+ warned = true;
}
}
+
+ for (int i = 0; i < MAX_MONSTERS; ++i)
+ {
+ const monsters *m = &menv[i];
+ if (!m->alive())
+ continue;
+ if (mgrd(m->pos()) != i)
+ {
+ mprf(MSGCH_WARN, "Floating monster: %s at (%d,%d)",
+ m->name(DESC_PLAIN).c_str(), m->x, m->y);
+ warned = true;
+ }
+ }
+ // If there are warnings, force the dev to notice. :P
+ if (warned)
+ more();
}
#endif