summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-clone.cc
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2010-03-17 11:10:54 +0100
committerRobert Vollmert <rvollmert@gmx.net>2010-03-17 11:55:46 +0100
commit3ec0fb9383c55ae72df179e9ffaf35673c4920a7 (patch)
treecf308889b2f2fd22f5f43ac1b890fc9db3abc397 /crawl-ref/source/mon-clone.cc
parenteee2a1418045006b132907a3981166df04ac1529 (diff)
downloadcrawl-ref-3ec0fb9383c55ae72df179e9ffaf35673c4920a7.tar.gz
crawl-ref-3ec0fb9383c55ae72df179e9ffaf35673c4920a7.zip
Fix mons_summon_illusion_from use of create_monster.
It was checking the return value against NON_MONSTER instead of -1, so a failed summon illusion would cause it to overwrite the end of env.items, likely leading to issue #1089. In debug builds, this triggered an assertion. Fixes issue #1089.
Diffstat (limited to 'crawl-ref/source/mon-clone.cc')
-rw-r--r--crawl-ref/source/mon-clone.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/mon-clone.cc b/crawl-ref/source/mon-clone.cc
index f1de1b9b77..c13b117624 100644
--- a/crawl-ref/source/mon-clone.cc
+++ b/crawl-ref/source/mon-clone.cc
@@ -202,7 +202,7 @@ void mons_summon_illusion_from(monsters *monster, actor *foe,
create_monster(
mgen_data(MONS_PLAYER_GHOST, SAME_ATTITUDE(monster), monster,
6, spell_cast, monster->pos(), monster->foe, 0));
- if (midx != NON_MONSTER)
+ if (midx != -1)
{
mpr("There is a horrible, sudden wrenching feeling in your soul!",
MSGCH_WARN);