diff --git a/src/game/Player.cpp b/src/game/Player.cpp index b7909f51c..cb7146f25 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -18356,18 +18356,20 @@ bool Player::HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item cons return false; } -bool Player::CanNoReagentCast(SpellEntry const* spellInfo) +bool Player::CanNoReagentCast(SpellEntry const* spellInfo) const { // don't take reagents for spells with SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP if (spellInfo->AttributesEx5 & SPELL_ATTR_EX5_NO_REAGENT_WHILE_PREP && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_PREPARATION)) return true; + // Check no reagent use mask uint64 noReagentMask_0_1 = GetUInt64Value(PLAYER_NO_REAGENT_COST_1); uint32 noReagentMask_2 = GetUInt64Value(PLAYER_NO_REAGENT_COST_1+2); if (spellInfo->SpellFamilyFlags & noReagentMask_0_1 || spellInfo->SpellFamilyFlags2 & noReagentMask_2) return true; + return false; } diff --git a/src/game/Player.h b/src/game/Player.h index 86c425b6b..53d676b9d 100644 --- a/src/game/Player.h +++ b/src/game/Player.h @@ -1102,7 +1102,7 @@ class MANGOS_DLL_SPEC Player : public Unit bool HasBankBagSlot( uint8 slot ) const; bool HasItemCount( uint32 item, uint32 count, bool inBankAlso = false ) const; bool HasItemFitToSpellReqirements(SpellEntry const* spellInfo, Item const* ignoreItem = NULL); - bool CanNoReagentCast(SpellEntry const* spellInfo); + bool CanNoReagentCast(SpellEntry const* spellInfo) const; Item* GetItemOrItemWithGemEquipped( uint32 item ) const; uint8 CanTakeMoreSimilarItems(Item* pItem) const { return _CanTakeMoreSimilarItems(pItem->GetEntry(),pItem->GetCount(),pItem); } uint8 CanTakeMoreSimilarItems(uint32 entry, uint32 count) const { return _CanTakeMoreSimilarItems(entry,count,NULL); } diff --git a/src/game/Spell.cpp b/src/game/Spell.cpp index 44d5ce31d..07aea8100 100644 --- a/src/game/Spell.cpp +++ b/src/game/Spell.cpp @@ -4691,11 +4691,7 @@ uint8 Spell::CheckItems() focusObject = ok; // game object found in range } - bool needReagentCheck = true; - if (m_caster->GetTypeId() == TYPEID_PLAYER && ((Player*)m_caster)->CanNoReagentCast(m_spellInfo)) - needReagentCheck = false; - - if (needReagentCheck) + if (!p_caster->CanNoReagentCast(m_spellInfo)) { for(uint32 i=0;i<8;i++) { diff --git a/src/game/SpellAuras.cpp b/src/game/SpellAuras.cpp index 809ee2462..4a8425dc7 100644 --- a/src/game/SpellAuras.cpp +++ b/src/game/SpellAuras.cpp @@ -1171,7 +1171,8 @@ void Aura::UpdateSlotCounterAndDuration(bool add) SetAuraCharges(count); SendAuraUpdate(false); } -bool Aura::isAffectedOnSpell(SpellEntry const *spell) + +bool Aura::isAffectedOnSpell(SpellEntry const *spell) const { // Check family name if (spell->SpellFamilyName != m_spellProto->SpellFamilyName) @@ -1184,6 +1185,7 @@ bool Aura::isAffectedOnSpell(SpellEntry const *spell) return true; return false; } + /*********************************************************/ /*** BASIC AURA FUNCTION ***/ /*********************************************************/ diff --git a/src/game/SpellAuras.h b/src/game/SpellAuras.h index 387b0a36c..2ad9dd3c4 100644 --- a/src/game/SpellAuras.h +++ b/src/game/SpellAuras.h @@ -304,8 +304,8 @@ class MANGOS_DLL_SPEC Aura void PeriodicTick(); void PeriodicDummyTick(); - inline uint32 const *getAuraSpellClassMask() {return m_spellProto->EffectSpellClassMaskA + m_effIndex * 3; } - bool isAffectedOnSpell(SpellEntry const *spell); + uint32 const *getAuraSpellClassMask() const { return m_spellProto->EffectSpellClassMaskA + m_effIndex * 3; } + bool isAffectedOnSpell(SpellEntry const *spell) const; protected: Aura(SpellEntry const* spellproto, uint32 eff, int32 *currentBasePoints, Unit *target, Unit *caster = NULL, Item* castItem = NULL);