Core/Auras: Fixed iterator invalidation crash with procs using SPELL_ATTR0_PROC_FAILURE_BURNS_CHARGE attribute
Port From (https://github.com/TrinityCore/TrinityCore/commit/15451ce699540c7d175f4a24d257778dedb0e3d7)
This commit is contained in:
@@ -1884,20 +1884,23 @@ namespace Game.Spells
|
||||
|
||||
public void TriggerProcOnEvent(uint procEffectMask, AuraApplication aurApp, ProcEventInfo eventInfo)
|
||||
{
|
||||
bool prevented = CallScriptProcHandlers(aurApp, eventInfo);
|
||||
if (!prevented)
|
||||
if (procEffectMask != 0)
|
||||
{
|
||||
for (byte i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
bool prevented = CallScriptProcHandlers(aurApp, eventInfo);
|
||||
if (!prevented)
|
||||
{
|
||||
if (!Convert.ToBoolean(procEffectMask & (1 << i)))
|
||||
continue;
|
||||
for (byte i = 0; i < SpellConst.MaxEffects; ++i)
|
||||
{
|
||||
if (!Convert.ToBoolean(procEffectMask & (1 << i)))
|
||||
continue;
|
||||
|
||||
// OnEffectProc / AfterEffectProc hooks handled in AuraEffect.HandleProc()
|
||||
if (aurApp.HasEffect(i))
|
||||
GetEffect(i).HandleProc(aurApp, eventInfo);
|
||||
// OnEffectProc / AfterEffectProc hooks handled in AuraEffect.HandleProc()
|
||||
if (aurApp.HasEffect(i))
|
||||
GetEffect(i).HandleProc(aurApp, eventInfo);
|
||||
}
|
||||
|
||||
CallScriptAfterProcHandlers(aurApp, eventInfo);
|
||||
}
|
||||
|
||||
CallScriptAfterProcHandlers(aurApp, eventInfo);
|
||||
}
|
||||
|
||||
ConsumeProcCharges(Global.SpellMgr.GetSpellProcEntry(GetSpellInfo()));
|
||||
|
||||
Reference in New Issue
Block a user