mirror of
https://github.com/azerothcore/azerothcore-wotlk.git
synced 2025-12-05 18:20:24 -08:00
fix(Core/Player): reapply talent auras on item change (#24048)
Co-authored-by: r0m1ntik <40755539+r0m1ntik@users.noreply.github.com>
This commit is contained in:
parent
88078c81f4
commit
20326e7330
1 changed files with 22 additions and 6 deletions
|
|
@ -7158,18 +7158,34 @@ void Player::ApplyItemDependentAuras(Item* item, bool apply)
|
||||||
{
|
{
|
||||||
if (apply)
|
if (apply)
|
||||||
{
|
{
|
||||||
PlayerSpellMap const& spells = GetSpellMap();
|
for (auto [spellId, playerSpell]: GetSpellMap())
|
||||||
for (auto itr = spells.begin(); itr != spells.end(); ++itr)
|
|
||||||
{
|
{
|
||||||
if (itr->second->State == PLAYERSPELL_REMOVED)
|
if (playerSpell->State == PLAYERSPELL_REMOVED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(itr->first);
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||||
if (!spellInfo || !spellInfo->IsPassive() || spellInfo->EquippedItemClass < 0)
|
if (!spellInfo || !spellInfo->IsPassive() || spellInfo->EquippedItemClass < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!HasAura(itr->first) && HasItemFitToSpellRequirements(spellInfo))
|
if (!HasAura(spellId) && HasItemFitToSpellRequirements(spellInfo))
|
||||||
AddAura(itr->first, this); // no SMSG_SPELL_GO in sniff found
|
AddAura(spellId, this); // no SMSG_SPELL_GO in sniff found
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check talents (they are stored separately from regular spells)
|
||||||
|
for (auto [spellId, playerTalent] : GetTalentMap())
|
||||||
|
{
|
||||||
|
if (playerTalent->State == PLAYERSPELL_REMOVED)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!(playerTalent->IsInSpec(GetActiveSpec())))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId);
|
||||||
|
if (!spellInfo || !spellInfo->IsPassive() || spellInfo->EquippedItemClass < 0)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!HasAura(spellId) && HasItemFitToSpellRequirements(spellInfo))
|
||||||
|
AddAura(spellId, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue