diff options
Diffstat (limited to 'crawl-ref/source/itemprop.cc')
-rw-r--r-- | crawl-ref/source/itemprop.cc | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index e0e6e5dc2b..829b6ca1b9 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -1313,16 +1313,14 @@ bool check_armour_shape( const item_def &item, bool quiet ) // Returns whether a wand or rod can be charged, or a weapon of electrocution // enchanted. -// If unknown is true, wands with unknown charges and weapons with unknown -// brand will also return true. // If hide_charged is true, wands known to be full will return false. // (This distinction is necessary because even full wands/rods give a message.) -bool item_is_rechargeable(const item_def &it, bool unknown, bool hide_charged) +bool item_is_rechargeable(const item_def &it, bool hide_charged, bool weapons) { // These are obvious... if (it.base_type == OBJ_WANDS) { - if (unknown && !hide_charged) + if (!hide_charged) return (true); // Don't offer wands already maximally charged. @@ -1336,7 +1334,7 @@ bool item_is_rechargeable(const item_def &it, bool unknown, bool hide_charged) } else if (item_is_rod(it)) { - if (unknown && !hide_charged) + if (!hide_charged) return (true); if (item_ident(it, ISFLAG_KNOW_PLUSES)) @@ -1348,16 +1346,16 @@ bool item_is_rechargeable(const item_def &it, bool unknown, bool hide_charged) } else if (it.base_type == OBJ_WEAPONS) { - if (unknown && !item_type_known(it)) // Could be electrocution. + // Might be electrocution. + if (weapons && !item_type_known(it)) return (true); // Weapons of electrocution can get +1 to-dam this way. if (!is_artefact(it) && get_weapon_brand(it) == SPWPN_ELECTROCUTION && item_type_known(it) - && (unknown && !item_ident(it, ISFLAG_KNOW_PLUSES ) - || item_ident(it, ISFLAG_KNOW_PLUSES ) - && it.plus2 < MAX_WPN_ENCHANT)) + && (!item_ident(it, ISFLAG_KNOW_PLUSES) + || it.plus2 < MAX_WPN_ENCHANT)) { return (true); } |