mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Core/Spells): Removed any triggered auras on glyph removal. (#12168)
* fix(Core/Spells): Removed any triggered auras on glyph removal. Fixes #11939 * Update.
This commit is contained in:
@@ -1579,6 +1579,23 @@ void WorldSession::HandleRemoveGlyph(WorldPacket& recvData)
|
||||
if (GlyphPropertiesEntry const* glyphEntry = sGlyphPropertiesStore.LookupEntry(glyph))
|
||||
{
|
||||
_player->RemoveAurasDueToSpell(glyphEntry->SpellId);
|
||||
|
||||
// Removed any triggered auras
|
||||
Unit::AuraMap& ownedAuras = _player->GetOwnedAuras();
|
||||
for (Unit::AuraMap::iterator iter = ownedAuras.begin(); iter != ownedAuras.end();)
|
||||
{
|
||||
Aura* aura = iter->second;
|
||||
if (SpellInfo const* triggeredByAuraSpellInfo = aura->GetTriggeredByAuraSpellInfo())
|
||||
{
|
||||
if (triggeredByAuraSpellInfo->Id == glyphEntry->SpellId)
|
||||
{
|
||||
_player->RemoveOwnedAura(iter);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
++iter;
|
||||
}
|
||||
|
||||
_player->SendLearnPacket(glyphEntry->SpellId, false); // Send packet to properly handle client-side spell tooltips
|
||||
_player->SetGlyph(slot, 0, true);
|
||||
_player->SendTalentsInfoData(false);
|
||||
|
||||
@@ -4401,6 +4401,23 @@ void Spell::EffectApplyGlyph(SpellEffIndex effIndex)
|
||||
if (GlyphPropertiesEntry const* oldGlyphEntry = sGlyphPropertiesStore.LookupEntry(oldGlyph))
|
||||
{
|
||||
player->RemoveAurasDueToSpell(oldGlyphEntry->SpellId);
|
||||
|
||||
// Removed any triggered auras
|
||||
Unit::AuraMap& ownedAuras = player->GetOwnedAuras();
|
||||
for (Unit::AuraMap::iterator iter = ownedAuras.begin(); iter != ownedAuras.end();)
|
||||
{
|
||||
Aura* aura = iter->second;
|
||||
if (SpellInfo const* triggeredByAuraSpellInfo = aura->GetTriggeredByAuraSpellInfo())
|
||||
{
|
||||
if (triggeredByAuraSpellInfo->Id == oldGlyphEntry->SpellId)
|
||||
{
|
||||
player->RemoveOwnedAura(iter);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
++iter;
|
||||
}
|
||||
|
||||
player->SendLearnPacket(oldGlyphEntry->SpellId, false); // Send packet to properly handle client-side spell tooltips
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user