summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-06 00:16:48 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-06 00:16:48 +0000
commit1c4c94863dd082b31c3d42736a5202388cc3e5a1 (patch)
tree497936c7296d6b893bced78b545e902c00a63555 /crawl-ref/source
parentfaeac7bac70c4d38a87500720f338058973fd993 (diff)
downloadcrawl-ref-1c4c94863dd082b31c3d42736a5202388cc3e5a1.tar.gz
crawl-ref-1c4c94863dd082b31c3d42736a5202388cc3e5a1.zip
Fix problem when traveling up and down levels after a period of time.
Summoned monsters' disappearing wasn't being taken into account after handling monster enchantments; a disappeared monster would have a type of -1; and the call to mons_habitat(), which looked at the monster type, would crash. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3210 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/effects.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 875110c604..c27afc653b 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -2449,6 +2449,10 @@ void update_level( double elapsedTime )
if (turns >= 10)
mon->timeout_enchantments( turns / 10 );
+ // Summoned monsters might have disappeared
+ if (mon->type == -1)
+ continue;
+
// Don't move non-land or stationary monsters around
if (mons_habitat( mon->type ) != HT_LAND
|| mons_is_stationary( mon ))