From fdb380cbbec225e390997af01d40a83859abb69b Mon Sep 17 00:00:00 2001 From: ennewalker Date: Sat, 19 Jul 2008 17:42:31 +0000 Subject: 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 --- crawl-ref/source/view.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; -- cgit v1.2.3-54-g00ecf