From dc3e12a4da48363a7cadb77f30b8e784d5f82acf Mon Sep 17 00:00:00 2001 From: Vsevolod Kozlov Date: Sun, 27 Dec 2009 19:25:32 +0300 Subject: Replace uses of item_cursed with item_def::cursed. --- crawl-ref/source/delay.cc | 2 +- crawl-ref/source/fight.cc | 4 ++-- crawl-ref/source/food.cc | 4 ++-- crawl-ref/source/invent.cc | 2 +- crawl-ref/source/item_use.cc | 42 +++++++++++++++++++++--------------------- crawl-ref/source/itemname.cc | 10 +++++----- crawl-ref/source/itemprop.cc | 9 ++------- crawl-ref/source/itemprop.h | 1 - crawl-ref/source/items.cc | 4 ++-- crawl-ref/source/l_item.cc | 2 +- crawl-ref/source/makeitem.cc | 2 +- crawl-ref/source/mon-stuff.cc | 2 +- crawl-ref/source/monster.cc | 6 +++--- crawl-ref/source/player.cc | 2 +- crawl-ref/source/religion.cc | 2 +- crawl-ref/source/spells2.cc | 4 ++-- crawl-ref/source/spells3.cc | 4 ++-- crawl-ref/source/tilereg.cc | 4 ++-- crawl-ref/source/tilesdl.cc | 2 +- crawl-ref/source/transfor.cc | 2 +- crawl-ref/source/tutorial.cc | 4 ++-- crawl-ref/source/wiz-item.cc | 2 +- 22 files changed, 55 insertions(+), 61 deletions(-) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index a3a6ca6d5d..56c166fdec 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1564,7 +1564,7 @@ void armour_wear_effects(const int item_slot) use_artefact(arm, &show_msgs, melded); } - if (item_cursed(arm) && !melded) + if (arm.cursed() && !melded) { mpr("Oops, that feels deathly cold."); learned_something_new(TUT_YOU_CURSED); diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc index 1543ddabb1..b2237a92cb 100644 --- a/crawl-ref/source/fight.cc +++ b/crawl-ref/source/fight.cc @@ -374,7 +374,7 @@ void melee_attack::check_hand_half_bonus_eligible() && !can_do_unarmed && !shield && weapon - && !item_cursed(*weapon) + && !weapon->cursed() && hands == HANDS_HALF); } @@ -3832,7 +3832,7 @@ int melee_attack::player_to_hit(bool random_factor) && !can_do_unarmed && !shield && weapon - && !item_cursed( *weapon ) + && !weapon ->cursed() && hands == HANDS_HALF; int your_to_hit = 15 + (calc_stat_to_hit_base() / 2); diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc index 112f9e1739..bd2db8d728 100644 --- a/crawl-ref/source/food.cc +++ b/crawl-ref/source/food.cc @@ -377,7 +377,7 @@ static void _terminate_butchery(bool wpn_switch, bool removed_gloves, { // Switch weapon back. if (wpn_switch && you.equip[EQ_WEAPON] != old_weapon - && (!you.weapon() || !item_cursed(*you.weapon()))) + && (!you.weapon() || !you.weapon()->cursed())) { start_delay(DELAY_WEAPON_SWAP, 1, old_weapon); } @@ -479,7 +479,7 @@ bool butchery(int which_corpse) && !player_wearing_slot(EQ_GLOVES); bool gloved_butcher = (you.has_claws() && player_wearing_slot(EQ_GLOVES) - && !item_cursed(you.inv[you.equip[EQ_GLOVES]])); + && !you.inv[you.equip[EQ_GLOVES]].cursed()); bool can_butcher = (teeth_butcher || barehand_butcher || you.weapon() && can_cut_meat(*you.weapon())); diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc index 047a502467..887fbd436c 100644 --- a/crawl-ref/source/invent.cc +++ b/crawl-ref/source/invent.cc @@ -109,7 +109,7 @@ const std::string &InvEntry::get_fullname() const bool InvEntry::is_item_cursed() const { - return (item_ident(*item, ISFLAG_KNOW_CURSE) && item_cursed(*item)); + return (item_ident(*item, ISFLAG_KNOW_CURSE) && item->cursed()); } bool InvEntry::is_item_glowing() const diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 38bf295a7a..fd01008e25 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -112,7 +112,7 @@ bool can_wield(item_def *weapon, bool say_reason, if (!ignore_temporary_disability && you.weapon() && you.weapon()->base_type == OBJ_WEAPONS - && item_cursed(*you.weapon())) + && you.weapon()->cursed()) { SAY(mpr("You can't unwield your weapon to draw a new one!")); return (false); @@ -721,7 +721,7 @@ void wield_effects(int item_wield_2, bool showMsgs) } } - if (item_cursed(item)) + if (item.cursed()) { mpr("It sticks to your hand!"); int amusement = 16; @@ -1059,7 +1059,7 @@ bool do_wear_armour(int item, bool quiet) && you.equip[EQ_CLOAK] != -1 && !cloak_is_being_removed()) { if (you.equip[EQ_BODY_ARMOUR] != -1 - && item_cursed(you.inv[you.equip[EQ_BODY_ARMOUR]])) + && you.inv[you.equip[EQ_BODY_ARMOUR]].cursed()) { if (!quiet) { @@ -1069,7 +1069,7 @@ bool do_wear_armour(int item, bool quiet) } return (false); } - if (!item_cursed(you.inv[you.equip[EQ_CLOAK]])) + if (!you.inv[you.equip[EQ_CLOAK]].cursed()) { cloak = you.equip[EQ_CLOAK]; if (!takeoff_armour(you.equip[EQ_CLOAK])) @@ -1149,7 +1149,7 @@ bool takeoff_armour(int item) } // If we get here, we're wearing the item. - if (item_cursed(invitem)) + if (invitem.cursed()) { mprf("%s is stuck to your body!", invitem.name(DESC_CAP_YOUR).c_str()); return (false); @@ -1165,7 +1165,7 @@ bool takeoff_armour(int item) { if (you.equip[EQ_CLOAK] != -1 && !cloak_is_being_removed()) { - if (!item_cursed(you.inv[you.equip[EQ_CLOAK]])) + if (!you.inv[you.equip[EQ_CLOAK]].cursed()) { cloak = you.equip[ EQ_CLOAK ]; if (!takeoff_armour(you.equip[EQ_CLOAK])) @@ -1453,7 +1453,7 @@ static bool _fire_validate_item(int slot, std::string &err) { if (slot == you.equip[EQ_WEAPON] && you.inv[slot].base_type == OBJ_WEAPONS - && item_cursed(you.inv[slot])) + && you.inv[slot].cursed()) { err = "That weapon is stuck to your hand!"; return (false); @@ -3481,7 +3481,7 @@ void jewellery_wear_effects(item_def &item) set_ident_flags(item, ISFLAG_EQ_JEWELLERY_MASK); } - if (item_cursed(item)) + if (item.cursed()) { mprf("Oops, that %s feels deathly cold.", jewellery_is_amulet(item)? "amulet" : "ring"); @@ -3510,7 +3510,7 @@ static int _prompt_ring_to_remove(int new_ring) const item_def *left = you.slot_item(EQ_LEFT_RING); const item_def *right = you.slot_item(EQ_RIGHT_RING); - if (item_cursed(*left) && item_cursed(*right)) + if (left->cursed() && right->cursed()) { mprf("You're already wearing two cursed rings!"); return (-1); @@ -3730,7 +3730,7 @@ static bool _swap_rings(int ring_slot) const item_def* lring = you.slot_item(EQ_LEFT_RING); const item_def* rring = you.slot_item(EQ_RIGHT_RING); - if (item_cursed(*lring) && item_cursed(*rring)) + if (lring->cursed() && rring->cursed()) { mprf("You're already wearing two cursed rings!"); return (false); @@ -3744,7 +3744,7 @@ static bool _swap_rings(int ring_slot) && lring->plus2 == rring->plus2 && !is_artefact(*lring) && !is_artefact(*rring)) { - if (item_cursed(*lring)) + if (lring->cursed()) unwanted = you.equip[EQ_RIGHT_RING]; else unwanted = you.equip[EQ_LEFT_RING]; @@ -3811,7 +3811,7 @@ bool puton_item(int item_slot) if (!is_amulet) // i.e. it's a ring { const item_def* gloves = you.slot_item(EQ_GLOVES); - if (gloves && item_cursed(*gloves)) + if (gloves && gloves->cursed()) { mpr("You can't take your gloves off to put on a ring!"); return (false); @@ -4025,7 +4025,7 @@ bool remove_ring(int slot, bool announce) } if (you.equip[EQ_GLOVES] != -1 - && item_cursed( you.inv[you.equip[EQ_GLOVES]] ) + && you.inv[you.equip[EQ_GLOVES]] .cursed() && you.equip[EQ_AMULET] == -1) { mpr("You can't take your gloves off to remove any rings!"); @@ -4089,7 +4089,7 @@ bool remove_ring(int slot, bool announce) } if (you.equip[EQ_GLOVES] != -1 - && item_cursed( you.inv[you.equip[EQ_GLOVES]] ) + && you.inv[you.equip[EQ_GLOVES]] .cursed() && (hand_used == EQ_LEFT_RING || hand_used == EQ_RIGHT_RING)) { mpr("You can't take your gloves off to remove any rings!"); @@ -4102,7 +4102,7 @@ bool remove_ring(int slot, bool announce) return (false); } - if (item_cursed( you.inv[you.equip[hand_used]] )) + if (you.inv[you.equip[hand_used]] .cursed()) { if (announce) { @@ -4771,7 +4771,7 @@ bool enchant_weapon(enchant_stat_type which_stat, bool quiet, item_def &wpn) return (false); } - const bool is_cursed = item_cursed(wpn); + const bool is_cursed = wpn.cursed(); // Missiles only have one stat. if (wpn.base_type == OBJ_MISSILES) @@ -4882,7 +4882,7 @@ bool enchant_armour(int &ac_change, bool quiet, item_def &arm) return (false); } - const bool is_cursed = item_cursed(arm); + const bool is_cursed = arm.cursed(); // Turn hides into mails where applicable. // NOTE: It is assumed that armour which changes in this way does @@ -5355,7 +5355,7 @@ void read_scroll(int slot) case SCR_CURSE_WEAPON: if (!you.weapon() || you.weapon()->base_type != OBJ_WEAPONS - || item_cursed(*you.weapon())) + || you.weapon()->cursed()) { canned_msg(MSG_NOTHING_HAPPENS); id_the_scroll = false; @@ -5383,7 +5383,7 @@ void read_scroll(int slot) { item_def& wpn = *you.weapon(); - const bool is_cursed = item_cursed(wpn); + const bool is_cursed = wpn.cursed(); if (wpn.base_type != OBJ_WEAPONS && wpn.base_type != OBJ_MISSILES || !is_cursed @@ -5491,7 +5491,7 @@ void read_scroll(int slot) int affected = EQ_WEAPON; for (int i = EQ_CLOAK; i <= EQ_BODY_ARMOUR; i++) { - if (you.equip[i] != -1 && !item_cursed(you.inv[you.equip[i]])) + if (you.equip[i] != -1 && !you.inv[you.equip[i]].cursed()) { count++; if (one_chance_in(count)) @@ -5695,7 +5695,7 @@ void use_artefact(item_def &item, bool *show_msgs, bool unmeld) artefact_wpn_learn_prop(item, ARTP_BERSERK); } - if (!unmeld && !item_cursed(item) && proprt[ARTP_CURSED] > 0 + if (!unmeld && !item.cursed() && proprt[ARTP_CURSED] > 0 && one_chance_in(proprt[ARTP_CURSED])) { do_curse_item( item, false ); diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 8d487d2682..c8ce048107 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -1037,7 +1037,7 @@ std::string item_def::name_aux(description_level_type desc, // this behaviour, *please* make it so that there is an option // that maintains this behaviour. -- bwr // Nor for artefacts. Again, the state should be obvious. --jpeg - if (item_cursed(*this)) + if (cursed()) buff << "cursed "; else if (Options.show_uncursed && !know_pluses && (!know_type || !is_artefact(*this))) @@ -1108,7 +1108,7 @@ std::string item_def::name_aux(description_level_type desc, if (know_brand) buff << weapon_brand_name(*this, terse); - if (know_curse && item_cursed(*this) && terse) + if (know_curse && cursed() && terse) buff << " (curse)"; break; @@ -1197,7 +1197,7 @@ std::string item_def::name_aux(description_level_type desc, case OBJ_ARMOUR: if (know_curse && !terse) { - if (item_cursed(*this)) + if (cursed()) buff << "cursed "; else if (Options.show_uncursed && !know_pluses) buff << "uncursed "; @@ -1310,7 +1310,7 @@ std::string item_def::name_aux(description_level_type desc, } } - if (know_curse && item_cursed(*this) && terse) + if (know_curse && cursed() && terse) buff << " (curse)"; break; @@ -1462,7 +1462,7 @@ std::string item_def::name_aux(description_level_type desc, if (know_curse) { - if (item_cursed(*this)) + if (cursed()) buff << "cursed "; else if (Options.show_uncursed && !terse && (!is_randart || !know_type) diff --git a/crawl-ref/source/itemprop.cc b/crawl-ref/source/itemprop.cc index ee8e022c63..ea2f8bd7b3 100644 --- a/crawl-ref/source/itemprop.cc +++ b/crawl-ref/source/itemprop.cc @@ -457,11 +457,6 @@ void init_properties() // // Item cursed status functions: // -bool item_cursed( const item_def &item ) -{ - return (item.flags & ISFLAG_CURSED); -} - bool item_known_cursed( const item_def &item ) { return ((item.flags & ISFLAG_KNOW_CURSE) && (item.flags & ISFLAG_CURSED)); @@ -1195,7 +1190,7 @@ bool is_enchantable_weapon(const item_def &wpn, bool uncurse, bool first) || first && wpn.plus >= MAX_WPN_ENCHANT || !first && wpn.plus2 >= MAX_WPN_ENCHANT) { - return (uncurse && item_cursed(wpn)); + return (uncurse && wpn.cursed()); } } // Highly enchanted missiles, which have only one stat, cannot be @@ -1228,7 +1223,7 @@ bool is_enchantable_armour(const item_def &arm, bool uncurse, bool unknown) // Artefacts or highly enchanted armour cannot be enchanted, only // uncursed. if (is_artefact(arm) || arm.plus >= armour_max_enchant(arm)) - return (uncurse && item_cursed(arm)); + return (uncurse && arm.cursed()); return (true); } diff --git a/crawl-ref/source/itemprop.h b/crawl-ref/source/itemprop.h index 3a38fdb35b..99c861da67 100644 --- a/crawl-ref/source/itemprop.h +++ b/crawl-ref/source/itemprop.h @@ -18,7 +18,6 @@ void init_properties(void); bool item_is_mundane(const item_def &item); // cursed: -bool item_cursed( const item_def &item ); bool item_known_cursed( const item_def &item ); bool item_known_uncursed( const item_def &item ); void do_curse_item( item_def &item, bool quiet = true ); diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index fa2b57fdea..7543da8ea5 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -1921,7 +1921,7 @@ bool drop_item( int item_dropped, int quant_drop, bool try_offer ) if (item_dropped == you.equip[EQ_WEAPON] && you.inv[item_dropped].base_type == OBJ_WEAPONS - && item_cursed( you.inv[item_dropped] )) + && you.inv[item_dropped] .cursed()) { mpr("That object is stuck to you!"); return (false); @@ -2821,7 +2821,7 @@ int item_def::book_number() const bool item_def::cursed() const { - return (item_cursed(*this)); + return (flags & ISFLAG_CURSED); } bool item_def::launched_by(const item_def &launcher) const diff --git a/crawl-ref/source/l_item.cc b/crawl-ref/source/l_item.cc index c2248e1682..80bbc88df9 100644 --- a/crawl-ref/source/l_item.cc +++ b/crawl-ref/source/l_item.cc @@ -463,7 +463,7 @@ static int l_item_cursed(lua_State *ls) { LUA_ITEM(item, 1); bool cursed = item && item_ident(*item, ISFLAG_KNOW_CURSE) - && item_cursed(*item); + && item->cursed(); lua_pushboolean(ls, cursed); return (1); } diff --git a/crawl-ref/source/makeitem.cc b/crawl-ref/source/makeitem.cc index ee473f1a04..977198929d 100644 --- a/crawl-ref/source/makeitem.cc +++ b/crawl-ref/source/makeitem.cc @@ -2924,7 +2924,7 @@ static void _generate_jewellery_item(item_def& item, bool allow_uniques, if (item.sub_type == RING_SLAYING ) // requires plus2 too { - if (item_cursed(item) && !one_chance_in(20)) + if (item.cursed() && !one_chance_in(20)) item.plus2 = -1 - random2avg(6, 2); else { diff --git a/crawl-ref/source/mon-stuff.cc b/crawl-ref/source/mon-stuff.cc index d8f0a8e7a2..730fb54ef2 100644 --- a/crawl-ref/source/mon-stuff.cc +++ b/crawl-ref/source/mon-stuff.cc @@ -198,7 +198,7 @@ bool curse_an_item( bool decay_potions, bool quiet ) || you.inv[i].base_type == OBJ_JEWELLERY || you.inv[i].base_type == OBJ_POTIONS) { - if (item_cursed( you.inv[i] )) + if (you.inv[i] .cursed()) continue; if (you.inv[i].base_type != OBJ_POTIONS diff --git a/crawl-ref/source/monster.cc b/crawl-ref/source/monster.cc index 4cefe30857..5285da7795 100644 --- a/crawl-ref/source/monster.cc +++ b/crawl-ref/source/monster.cc @@ -577,11 +577,11 @@ bool monsters::can_wield(const item_def& item, bool ignore_curse, if (!ignore_curse) { int num_cursed = 0; - if (weap1 && item_cursed(*weap1)) + if (weap1 && weap1->cursed()) num_cursed++; - if (weap2 && item_cursed(*weap2)) + if (weap2 && weap2->cursed()) num_cursed++; - if (_shield && item_cursed(*_shield)) + if (_shield && _shield->cursed()) num_cursed++; if (two_handed && num_cursed > 0 || num_cursed >= avail_slots) diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index f16b6742c6..04c1498297 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -5732,7 +5732,7 @@ bool player::can_wield(const item_def& item, bool ignore_curse, { if (equip[EQ_WEAPON] != -1 && !ignore_curse) { - if (item_cursed(inv[equip[EQ_WEAPON]])) + if (inv[equip[EQ_WEAPON]].cursed()) return (false); } diff --git a/crawl-ref/source/religion.cc b/crawl-ref/source/religion.cc index 2524fbfcd5..763f1c0709 100644 --- a/crawl-ref/source/religion.cc +++ b/crawl-ref/source/religion.cc @@ -4230,7 +4230,7 @@ static bool _bless_weapon(god_type god, brand_type brand, int colour) set_item_ego_type(wpn, OBJ_WEAPONS, brand); wpn.colour = colour; - const bool is_cursed = item_cursed(wpn); + const bool is_cursed = wpn.cursed(); enchant_weapon(ENCHANT_TO_HIT, true, wpn); diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 4902786aa6..d765d4db5f 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -1101,7 +1101,7 @@ bool cast_sticks_to_snakes(int pow, god_type god) const int dur = std::min(3 + random2(pow) / 20, 5); int how_many_max = 1 + random2(1 + you.skills[SK_TRANSMUTATIONS]) / 4; - const bool friendly = (!item_cursed(wpn)); + const bool friendly = (!wpn.cursed()); const beh_type beha = (friendly) ? BEH_FRIENDLY : BEH_HOSTILE; int count = 0; @@ -1712,7 +1712,7 @@ bool cast_tukimas_dance(int pow, god_type god, bool force_hostile) if (success) { // Cursed weapons become hostile. - const bool friendly = (!force_hostile && !item_cursed(you.inv[wpn])); + const bool friendly = (!force_hostile && !you.inv[wpn].cursed()); mgen_data mg(MONS_DANCING_WEAPON, friendly ? BEH_FRIENDLY : BEH_HOSTILE, diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc index 3a7f8130e1..1a30607199 100644 --- a/crawl-ref/source/spells3.cc +++ b/crawl-ref/source/spells3.cc @@ -130,7 +130,7 @@ bool remove_curse(bool suppress_msg) // Only cursed *weapons* in hand count as cursed. - bwr if (you.weapon() && you.weapon()->base_type == OBJ_WEAPONS - && item_cursed(*you.weapon())) + && you.weapon()->cursed()) { // Also sets wield_change. do_uncurse_item(*you.weapon()); @@ -142,7 +142,7 @@ bool remove_curse(bool suppress_msg) for (int i = EQ_WEAPON + 1; i < NUM_EQUIP; i++) { // Melded equipment can also get uncursed this way. - if (you.equip[i] != -1 && item_cursed(you.inv[you.equip[i]])) + if (you.equip[i] != -1 && you.inv[you.equip[i]].cursed()) { do_uncurse_item(you.inv[you.equip[i]]); success = true; diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 82ed562c56..4490e3a59a 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -2484,7 +2484,7 @@ static bool _can_use_item(const item_def &item, bool equipped) && mons_has_blood(item.plus)); } - if (equipped && item_cursed(item)) + if (equipped && item.cursed()) { // Misc. items/rods can always be evoked, cursed or not. if (item.base_type == OBJ_MISCELLANY || item_is_rod(item)) @@ -2770,7 +2770,7 @@ bool InventoryRegion::update_tip_text(std::string& tip) tip += "\n[R-Click] Info"; // Has to be non-equipped or non-cursed to drop. if (!equipped || !_is_true_equipped_item(you.inv[idx]) - || !item_cursed(you.inv[idx])) + || !you.inv[idx].cursed()) { tip += "\n[Shift-L-Click] Drop (d)"; } diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index e3c1e978fd..50dbb83f58 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -1433,7 +1433,7 @@ static void _fill_item_info(InventoryTile &desc, const item_def &item) desc.special = tile_known_weapon_brand(item); desc.flag = 0; - if (item_cursed(item) && item_ident(item, ISFLAG_KNOW_CURSE)) + if (item.cursed() && item_ident(item, ISFLAG_KNOW_CURSE)) desc.flag |= TILEI_FLAG_CURSE; if (item_type_tried(item)) desc.flag |= TILEI_FLAG_TRIED; diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc index 39f932a5eb..eaa1d12afb 100644 --- a/crawl-ref/source/transfor.cc +++ b/crawl-ref/source/transfor.cc @@ -311,7 +311,7 @@ static bool _check_for_cursed_equipment(const std::set &remove, continue; const item_def& item = you.inv[ you.equip[e] ]; - if (item_cursed(item)) + if (item.cursed()) { if (e != EQ_WEAPON && _tran_may_meld_cursed(trans)) continue; diff --git a/crawl-ref/source/tutorial.cc b/crawl-ref/source/tutorial.cc index 7f6bc68bc8..69aeb760a2 100644 --- a/crawl-ref/source/tutorial.cc +++ b/crawl-ref/source/tutorial.cc @@ -1549,7 +1549,7 @@ static bool _cant_butcher() if (!wpn || wpn->base_type != OBJ_WEAPONS) return false; - return (item_cursed(*wpn) && !can_cut_meat(*wpn)); + return (wpn->cursed() && !can_cut_meat(*wpn)); } static int _num_butchery_tools() @@ -3012,7 +3012,7 @@ void learned_something_new(tutorial_event_type seen_what, coord_def gc) int wpn = you.equip[EQ_WEAPON]; if (wpn != -1 && you.inv[wpn].base_type == OBJ_WEAPONS - && item_cursed(you.inv[wpn])) + && you.inv[wpn].cursed()) { // Don't trigger if the wielded weapon is cursed. Tutorial.tutorial_events[seen_what] = true; diff --git a/crawl-ref/source/wiz-item.cc b/crawl-ref/source/wiz-item.cc index b4b94bb94f..6fa4b411b0 100644 --- a/crawl-ref/source/wiz-item.cc +++ b/crawl-ref/source/wiz-item.cc @@ -697,7 +697,7 @@ void wizard_uncurse_item() { item_def& item(you.inv[i]); - if (item_cursed(item)) + if (item.cursed()) do_uncurse_item(item); else if (_item_type_can_be_cursed(item.base_type)) do_curse_item(item); -- cgit v1.2.3-54-g00ecf