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:
@@ -283,19 +283,21 @@ namespace Game.Spells
|
|||||||
ApplySpellMod(aurApp.GetTarget(), apply);
|
ApplySpellMod(aurApp.GetTarget(), apply);
|
||||||
|
|
||||||
// call scripts helping/replacing effect handlers
|
// call scripts helping/replacing effect handlers
|
||||||
bool prevented = false;
|
bool prevented;
|
||||||
if (apply)
|
if (apply)
|
||||||
prevented = GetBase().CallScriptEffectApplyHandlers(this, aurApp, mode);
|
prevented = GetBase().CallScriptEffectApplyHandlers(this, aurApp, mode);
|
||||||
else
|
else
|
||||||
prevented = GetBase().CallScriptEffectRemoveHandlers(this, aurApp, mode);
|
prevented = GetBase().CallScriptEffectRemoveHandlers(this, aurApp, mode);
|
||||||
|
|
||||||
// check if script events have removed the aura or if default effect prevention was requested
|
// check if script events have removed the aura already
|
||||||
if ((apply && aurApp.HasRemoveMode()) || prevented)
|
if (apply && aurApp.HasRemoveMode())
|
||||||
return;
|
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())
|
if (apply && aurApp.HasRemoveMode())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user