diff options
| -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 |
