From 20326e73301abc9fa49dac6fb8b1f4325cba2640 Mon Sep 17 00:00:00 2001 From: Tereneckla Date: Fri, 5 Dec 2025 09:36:13 +0000 Subject: [PATCH] fix(Core/Player): reapply talent auras on item change (#24048) Co-authored-by: r0m1ntik <40755539+r0m1ntik@users.noreply.github.com> --- src/server/game/Entities/Player/Player.cpp | 28 +++++++++++++++++----- 1 file 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(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); // 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