diff options
-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. |