Core/Player: fix regression with EquippedItemClass requiring spells

This commit is contained in:
Aokromes committed 2016-11-27 03:15:05 +01:00
1 parent f2fdbd81d6
commit 90dc4159b2
1 file changed
+10 -1
+10 -1
View File
@@ -3408,7 +3408,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())
{
@@ -3676,6 +3676,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;
}
if (spellInfo->HasAttribute(SPELL_ATTR8_MASTERY_SPECIALIZATION))
need_cast &= IsCurrentSpecMasterySpell(spellInfo);