Core/Auras: Fixed iterator invalidation crash with procs using SPELL_ATTR0_PROC_FAILURE_BURNS_CHARGE attribute

This commit is contained in:
Shauren authored and Ovahlord committed 2025-08-03 14:11:56 +02:00
1 parent 744aa1fd96
commit b13703f1ea
2 files changed
+4 -1

No files matched your search

+1 -1
View File
@@ -9863,7 +9863,7 @@ void Unit::GetProcAurasTriggeredOnEvent(AuraApplicationProcContainer& aurasTrigg
if (SpellProcEntry const* procEntry = sSpellMgr->GetSpellProcEntry(aurApp->GetBase()->GetSpellInfo()->Id))
{
aurApp->GetBase()->PrepareProcChargeDrop(procEntry, eventInfo);
aurApp->GetBase()->ConsumeProcCharges(procEntry);
aurasTriggeringProc.emplace_back(0, aurApp);
}
}
@@ -1978,6 +1978,8 @@ float Aura::CalcProcChance(SpellProcEntry const& procEntry, ProcEventInfo& event
}
void Aura::TriggerProcOnEvent(uint8 procEffectMask, AuraApplication* aurApp, ProcEventInfo& eventInfo)
{
if (procEffectMask)
{
bool prevented = CallScriptProcHandlers(aurApp, eventInfo);
if (!prevented)
@@ -1994,6 +1996,7 @@ void Aura::TriggerProcOnEvent(uint8 procEffectMask, AuraApplication* aurApp, Pro
CallScriptAfterProcHandlers(aurApp, eventInfo);
}
}
ConsumeProcCharges(ASSERT_NOTNULL(sSpellMgr->GetSpellProcEntry(GetSpellInfo()->Id)));
}