From 79987369e5602ec4f6e96ad626386a585411c23f Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sat, 22 Aug 2020 14:42:28 -0400 Subject: [PATCH] Prevent an issue that stopped Aura AfterEffect handlers being called on default handler prevention. Port From (https://github.com/TrinityCore/TrinityCore/commit/2c3a107bee6f600c1f4ab6124727fc58fdb48199) --- Source/Game/Spells/Auras/AuraEffect.cs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Source/Game/Spells/Auras/AuraEffect.cs b/Source/Game/Spells/Auras/AuraEffect.cs index e1a706d58..ed94efe33 100644 --- a/Source/Game/Spells/Auras/AuraEffect.cs +++ b/Source/Game/Spells/Auras/AuraEffect.cs @@ -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;