summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-26 18:56:45 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-26 18:56:45 +0000
commit05f88f06a2e406d12ce5acecf52764406e31cb2c (patch)
treec8a12ff02256964dd8773f9ad6d90805ffde52e5 /crawl-ref/source/spells3.cc
parentb5789ec262b15387d1a8d210dee9c79631e85ed6 (diff)
downloadcrawl-ref-05f88f06a2e406d12ce5acecf52764406e31cb2c.tar.gz
crawl-ref-05f88f06a2e406d12ce5acecf52764406e31cb2c.zip
Fix a bug in monster summoning that was causing crashes, for example
when attempting to cast Shadow Creatures in a bazaar (which is bound to fail, anyway). I guess it would have also caused crashes anywhere else where the level was devoid of monsters and creating one failed - for whatever reason. I don't actually know how likely that combination is. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6151 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc18
1 files changed, 7 insertions, 11 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index d3b5ae799a..524cf1f790 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -563,26 +563,22 @@ bool cast_summon_greater_demon(int pow, god_type god)
bool cast_shadow_creatures(god_type god)
{
- bool success = false;
-
mpr("Wisps of shadow whirl around you...");
const int monster =
create_monster(
mgen_data(RANDOM_MONSTER, BEH_FRIENDLY, 2,
you.pos(), you.pet_target,
- MG_FORCE_BEH, god));
+ MG_FORCE_BEH, god), false);
- if (monster != -1)
+ if (monster == -1)
{
- success = true;
-
- player_angers_monster(&menv[monster]);
+ mpr("The shadows disperse without effect.");
+ return (false);
}
- else
- canned_msg(MSG_NOTHING_HAPPENS);
- return (success);
+ player_angers_monster(&menv[monster]);
+ return (true);
}
bool cast_summon_horrible_things(int pow, god_type god)
@@ -640,7 +636,7 @@ bool cast_summon_horrible_things(int pow, god_type god)
if (count > 0)
{
- mprf("Some Thing%s answered your call!",
+ mprf("Some thing%s answered your call!",
count > 1 ? "s" : "");
return (true);
}