diff options
author | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-16 13:26:02 +0000 |
---|---|---|
committer | dshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573> | 2007-04-16 13:26:02 +0000 |
commit | 1eafe2f71f771bfe5ceb07f75d8180010aa56072 (patch) | |
tree | 591b831eefe13fc690062861db57497664c67a3f /crawl-ref | |
parent | 7ebfea944a75a5c799d87d038ad9f6e67e79bed5 (diff) | |
download | crawl-ref-1eafe2f71f771bfe5ceb07f75d8180010aa56072.tar.gz crawl-ref-1eafe2f71f771bfe5ceb07f75d8180010aa56072.zip |
Produce a message when a wielded rod has finished recharging.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1321 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/acr.cc | 8 | ||||
-rw-r--r-- | crawl-ref/source/spl-book.cc | 14 |
2 files changed, 11 insertions, 11 deletions
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc index 19b9ec9af6..42291db7ac 100644 --- a/crawl-ref/source/acr.cc +++ b/crawl-ref/source/acr.cc @@ -802,8 +802,12 @@ static bool recharge_rod( item_def &rod, bool wielded ) if (rod.plus > rod.plus2) rod.plus = rod.plus2; - if (wielded && rod.plus == rod.plus2 && is_resting()) - stop_running(); + if (wielded && rod.plus == rod.plus2) + { + mpr("Your rod has recharged."); + if (is_resting()) + stop_running(); + } return (true); } diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc index 12cdc1c8a3..d3ca45dd64 100644 --- a/crawl-ref/source/spl-book.cc +++ b/crawl-ref/source/spl-book.cc @@ -1314,15 +1314,11 @@ int count_staff_spells(const item_def &item, bool need_id) if (stype < STAFF_SMITING || stype >= STAFF_AIR) return (0); - int num_spells = 0; - for (int i = 0; i < SPELLBOOK_SIZE; num_spells++) - { - if (is_valid_spell_in_book(type, i)) - ++num_spells; - else - break; - } - return num_spells; + int nspel = 0; + while (nspel < SPELLBOOK_SIZE && is_valid_spell_in_book(type, nspel)) + ++nspel; + + return (nspel); } // Returns a measure of the rod spell power disrupted by a worn shield. |