mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-17 13:39:46 -04:00
Core/Player: fix regression with EquippedItemClass requiring spells
This commit is contained in:
@@ -3323,7 +3323,7 @@ bool Player::AddSpell(uint32 spellId, bool active, bool learning, bool dependent
|
||||
if (active)
|
||||
{
|
||||
if (spellInfo->IsPassive() && IsNeedCastPassiveSpellAtLearn(spellInfo))
|
||||
CastSpell (this, spellId, true);
|
||||
CastSpell(this, spellId, true);
|
||||
}
|
||||
else if (IsInWorld())
|
||||
{
|
||||
@@ -3597,6 +3597,15 @@ bool Player::IsNeedCastPassiveSpellAtLearn(SpellInfo const* spellInfo) const
|
||||
bool need_cast = (!spellInfo->Stances || (form && (spellInfo->Stances & (UI64LIT(1) << (form - 1)))) ||
|
||||
(!form && spellInfo->HasAttribute(SPELL_ATTR2_NOT_NEED_SHAPESHIFT)));
|
||||
|
||||
// Check EquippedItemClass
|
||||
// passive spells which apply aura and have an item requirement are to be added in Player::ApplyItemDependentAuras
|
||||
if (spellInfo->IsPassive() && spellInfo->EquippedItemClass >= 0)
|
||||
{
|
||||
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
|
||||
if (spellInfo->Effects[i].IsAura())
|
||||
return false;
|
||||
}
|
||||
|
||||
//Check CasterAuraStates
|
||||
return need_cast && (!spellInfo->CasterAuraState || HasAuraState(AuraStateType(spellInfo->CasterAuraState)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user