From 05f88f06a2e406d12ce5acecf52764406e31cb2c Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 26 Jun 2008 18:56:45 +0000 Subject: 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 --- crawl-ref/source/spells3.cc | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'crawl-ref/source/spells3.cc') 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); } -- cgit v1.2.3-54-g00ecf