summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/startup.cc
diff options
context:
space:
mode:
authorSteve Melenchuk <smelenchuk@gmail.com>2012-08-10 09:52:24 -0600
committerSteve Melenchuk <smelenchuk@gmail.com>2012-08-10 09:52:24 -0600
commitc8bb0a582d97b220427005690d3f7cd583810d65 (patch)
tree17059f632d26fb199fe28701f643d41ab42f2bb9 /crawl-ref/source/startup.cc
parentc486b34704d29439f9a0b5a3969c973c27ee3624 (diff)
downloadcrawl-ref-c8bb0a582d97b220427005690d3f7cd583810d65.tar.gz
crawl-ref-c8bb0a582d97b220427005690d3f7cd583810d65.zip
When clearing monster data between levels, clear constriction data properly.
810e6f85 removed clearing constriction data from monster::reset() and introduced an assert() that monsters were not being constricted when they were reset. While this would work for freshly-initialised monsters, the level builder and level loading code both used reset() to clear the entire array of monsters in preparation for new monster data, causing a crash on failed assertion whenever the player tried to leave the level when any monster on the level was constricting something. This commit introduces a reset_all_monsters() function to replace the snippets where the monster data was being cleared, and clears constriction data for valid monsters before calling reset() on them. Fixes #6055.
Diffstat (limited to 'crawl-ref/source/startup.cc')
-rw-r--r--crawl-ref/source/startup.cc3
1 files changed, 1 insertions, 2 deletions
diff --git a/crawl-ref/source/startup.cc b/crawl-ref/source/startup.cc
index 8189fadbc9..41abed0226 100644
--- a/crawl-ref/source/startup.cc
+++ b/crawl-ref/source/startup.cc
@@ -95,8 +95,7 @@ static void _initialize()
// Empty messaging string.
info[0] = 0;
- for (int i = 0; i < MAX_MONSTERS; ++i)
- menv[i].reset();
+ reset_all_monsters();
igrd.init(NON_ITEM);
mgrd.init(NON_MONSTER);