Prevent an issue that stopped Aura AfterEffect handlers being called on default handler prevention.

Port From (https://github.com/TrinityCore/TrinityCore/commit/2c3a107bee6f600c1f4ab6124727fc58fdb48199)
This commit is contained in:
hondacrx
2020-08-22 14:42:28 -04:00
parent e942d80fa5
commit 79987369e5
+7 -5
View File
@@ -283,19 +283,21 @@ namespace Game.Spells
ApplySpellMod(aurApp.GetTarget(), apply);
// call scripts helping/replacing effect handlers
bool prevented = false;
bool prevented;
if (apply)
prevented = GetBase().CallScriptEffectApplyHandlers(this, aurApp, mode);
else
prevented = GetBase().CallScriptEffectRemoveHandlers(this, aurApp, mode);
// check if script events have removed the aura or if default effect prevention was requested
if ((apply && aurApp.HasRemoveMode()) || prevented)
// check if script events have removed the aura already
if (apply && aurApp.HasRemoveMode())
return;
Global.SpellMgr.GetAuraEffectHandler(GetAuraType()).Invoke(this, aurApp, mode, apply);
// call default effect handler if it wasn't prevented
if (!prevented)
Global.SpellMgr.GetAuraEffectHandler(GetAuraType()).Invoke(this, aurApp, mode, apply);
// check if script events have removed the aura or if default effect prevention was requested
// check if the default handler reemoved the aura
if (apply && aurApp.HasRemoveMode())
return;