summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/dbg-scan.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-09-10 13:15:48 +0200
committerAdam Borowski <kilobyte@angband.pl>2013-09-10 13:37:55 +0200
commit77db7acd7d413bcf7d582d3fc7074c34eb2aa228 (patch)
treeabf4f7634617e300f1dc1f6108ac5935da4bc3fb /crawl-ref/source/dbg-scan.cc
parentd23e3647dfe4eaf4535d458d4edfa812ae8c1085 (diff)
downloadcrawl-ref-77db7acd7d413bcf7d582d3fc7074c34eb2aa228.tar.gz
crawl-ref-77db7acd7d413bcf7d582d3fc7074c34eb2aa228.zip
Check for constriction out of sync for monsters too.
Diffstat (limited to 'crawl-ref/source/dbg-scan.cc')
-rw-r--r--crawl-ref/source/dbg-scan.cc20
1 files changed, 16 insertions, 4 deletions
diff --git a/crawl-ref/source/dbg-scan.cc b/crawl-ref/source/dbg-scan.cc
index 3f78f76a7e..626f440b99 100644
--- a/crawl-ref/source/dbg-scan.cc
+++ b/crawl-ref/source/dbg-scan.cc
@@ -472,14 +472,26 @@ void debug_mons_scan()
if (you.constricted_by == m->mid && (!m->constricting
|| m->constricting->find(MID_PLAYER) == m->constricting->end()))
{
- mprf(MSGCH_ERROR, "Error: constricting[] entry missing for monster %s(%d)",
+ mprf(MSGCH_ERROR, "Error: constricting[you] entry missing for monster %s(%d)",
m->name(DESC_PLAIN, true).c_str(), m->mindex());
}
- if (m->constricted_by && !actor_by_mid(m->constricted_by))
+ if (m->constricted_by)
{
- mprf(MSGCH_ERROR, "Error: constrictor missing for monster %s(%d)",
- m->name(DESC_PLAIN, true).c_str(), m->mindex());
+ const actor *h = actor_by_mid(m->constricted_by);
+ if (!h)
+ {
+ mprf(MSGCH_ERROR, "Error: constrictor missing for monster %s(%d)",
+ m->name(DESC_PLAIN, true).c_str(), m->mindex());
+ }
+ if (!h->constricting
+ || h->constricting->find(m->mid) == h->constricting->end())
+ {
+ mprf(MSGCH_ERROR, "Error: constricting[%s(mindex=%d mid=%d)] "
+ "entry missing for monster %s(mindex=%d mid=%d)",
+ h->name(DESC_PLAIN, true).c_str(), h->mindex(), h->mid,
+ m->name(DESC_PLAIN, true).c_str(), m->mindex(), m->mid);
+ }
}
} // for (int i = 0; i < MAX_MONSTERS; ++i)