From 07dae10ec572e5757acffd430760b2f05214172f Mon Sep 17 00:00:00 2001 From: dolorous Date: Sat, 14 Mar 2009 23:21:21 +0000 Subject: Add more miscellaneous minor fixes. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9484 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells3.cc | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'crawl-ref/source/spells3.cc') diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 8ee9e5e357..ace14c81ce 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -987,7 +987,8 @@ int animate_dead(actor *caster, int pow, beh_type beha, unsigned short hitting, // reforming the original monster out of ice anyways. bool cast_simulacrum(int pow, god_type god) { - bool rc = false; + bool success = false; + const item_def* weapon = you.weapon(); if (weapon @@ -1001,10 +1002,6 @@ bool cast_simulacrum(int pow, god_type god) int how_many = std::min(8, 4 + random2(pow) / 20); how_many = std::min(how_many, weapon->quantity); - dec_inv_item_quantity(you.equip[EQ_WEAPON], how_many); - - int count = 0; - for (int i = 0; i < how_many; ++i) { const int monster = @@ -1016,13 +1013,15 @@ bool cast_simulacrum(int pow, god_type god) if (monster != -1) { - count++; + success = true; + + dec_inv_item_quantity(you.equip[EQ_WEAPON], 1); player_angers_monster(&menv[monster]); } } - if (count == 0) + if (!success) canned_msg(MSG_NOTHING_HAPPENS); } else @@ -1031,7 +1030,7 @@ bool cast_simulacrum(int pow, god_type god) "effective!"); } - return (rc); + return (success); } bool cast_twisted_resurrection(int pow, god_type god) -- cgit v1.2.3-54-g00ecf