summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-19 17:42:31 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-07-19 17:42:31 +0000
commitfdb380cbbec225e390997af01d40a83859abb69b (patch)
tree3f8d84d283c37c79aeb2994362e638dfb1772000
parenteb9361751933e33679d2eeed95f82366a17ef8b8 (diff)
downloadcrawl-ref-fdb380cbbec225e390997af01d40a83859abb69b.tar.gz
crawl-ref-fdb380cbbec225e390997af01d40a83859abb69b.zip
Applying r6615 to 0.4.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.4@6617 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/source/view.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index 67ded0088c..c2fb6f4870 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -1139,6 +1139,23 @@ void monster_grid(bool do_updates)
handle_monster_shouts(monster);
}
+ // [enne] - It's possible that mgrd and monster->x/y are out of
+ // sync because they are updated separately. If we can see this
+ // monster, then make sure that the mgrd is set correctly.
+ if (mgrd[monster->x][monster->y] != s)
+ {
+#ifdef DEBUG_DIAGNOSTICS
+ // If this mprf triggers for you, please note any special
+ // circumstances so we can track down where this is coming
+ // from.
+ mprf(MSGCH_DIAGNOSTICS, "monster (%d) at (%d, %d) was "
+ "improperly placed. Updating mgrd.", s,
+ monster->x, monster->y);
+#endif
+ ASSERT(mgrd[monster->x][monster->y] == NON_MONSTER);
+ mgrd[monster->x][monster->y] = s;
+ }
+
if (!_update_monster_grid(monster))
continue;