fix(Core/Hook): Fix OnAuraRemove not being called for owned auras. (#15930)

* Fix OnAuraRemove hook not being called for owned auras.

* Removed OnAuraRemove from multiple places and moved to singular call.
This commit is contained in:
AnchyDev
2023-04-18 11:10:57 +10:00
committed by GitHub
parent e38b070239
commit 570c0e8498

View File

@@ -4575,6 +4575,8 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator& i, AuraRemoveMode removeMo
// only way correctly remove all auras from list
//if (removedAuras != m_removedAurasCount) new aura may be added
i = m_appliedAuras.begin();
sScriptMgr->OnAuraRemove(this, aurApp, removeMode);
}
void Unit::_UnapplyAura(AuraApplication* aurApp, AuraRemoveMode removeMode)
@@ -4718,8 +4720,6 @@ void Unit::RemoveAura(AuraApplicationMap::iterator& i, AuraRemoveMode mode)
// Remove aura - for Area and Target auras
if (aura->GetOwner() == this)
aura->Remove(mode);
sScriptMgr->OnAuraRemove(this, aurApp, mode);
}
void Unit::RemoveAura(uint32 spellId, ObjectGuid caster, uint8 reqEffMask, AuraRemoveMode removeMode)