diff options
| author | Tereneckla <Tereneckla@pm.me> | 2025-12-05 09:36:13 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-05 06:36:13 -0300 |
| commit | 20326e73301abc9fa49dac6fb8b1f4325cba2640 (patch) | |
| tree | a62ace5370ee77da5db4869edd025796fcee4a63 | |
| parent | 88078c81f4f44285098ef5231afa48e7dd92460b (diff) | |
fix(Core/Player): reapply talent auras on item change (#24048)
Co-authored-by: r0m1ntik <40755539+r0m1ntik@users.noreply.github.com>
| -rw-r--r-- | src/server/game/Entities/Player/Player.cpp | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/src/server/game/Entities/Player/Player.cpp b/src/server/game/Entities/Player/Player.cpp index 5bcd49fcf3..571817a42b 100644 --- a/src/server/game/Entities/Player/Player.cpp +++ b/src/server/game/Entities/Player/Player.cpp @@ -7158,18 +7158,34 @@ void Player::ApplyItemDependentAuras(Item* item, bool apply) { if (apply) { - PlayerSpellMap const& spells = GetSpellMap(); - for (auto itr = spells.begin(); itr != spells.end(); ++itr) + for (auto [spellId, playerSpell]: GetSpellMap()) { - if (itr->second->State == PLAYERSPELL_REMOVED) + if (playerSpell->State == PLAYERSPELL_REMOVED) + continue; + + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); + if (!spellInfo || !spellInfo->IsPassive() || spellInfo->EquippedItemClass < 0) + continue; + + if (!HasAura(spellId) && HasItemFitToSpellRequirements(spellInfo)) + 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(itr->first); + SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellId); if (!spellInfo || !spellInfo->IsPassive() || spellInfo->EquippedItemClass < 0) continue; - if (!HasAura(itr->first) && HasItemFitToSpellRequirements(spellInfo)) - AddAura(itr->first, this); // no SMSG_SPELL_GO in sniff found + if (!HasAura(spellId) && HasItemFitToSpellRequirements(spellInfo)) + AddAura(spellId, this); } } else |
