From 8a1cfbaeb1e8ba2c3f293a0ec1fd3c14ee4cf8d0 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 21 Sep 2021 18:53:17 -0400 Subject: [PATCH] Core/Spells: fix delayed hit aura crash Port From (https://github.com/TrinityCore/TrinityCore/commit/c8d7289245c0d60f25f355452574c1258baa7380) --- Source/Game/Spells/Spell.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 9aadd6f86..a3344f3a0 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -2084,7 +2084,10 @@ namespace Game.Spells } } else + { + hitInfo.HitAura = spellAura; spellAura.AddStaticApplication(unit, aura_effmask); + } } } @@ -7663,6 +7666,7 @@ namespace Game.Spells public int AuraDuration; public int[] AuraBasePoints = new int[SpellConst.MaxEffects]; public bool Positive = true; + public UnitAura HitAura; Unit _spellHitTarget; // changed for example by reflect bool _enablePVP; // need to enable PVP at DoDamageAndTriggers? @@ -7964,9 +7968,9 @@ namespace Game.Spells else if (spell.GetCaster().IsGameObject() && spell.GetCaster().ToGameObject().GetAI() != null) spell.GetCaster().ToGameObject().GetAI().SpellHitTarget(_spellHitTarget, spell.m_spellInfo); - if (spell.spellAura != null) + if (HitAura != null) { - AuraApplication aurApp = spell.spellAura.GetApplicationOfTarget(_spellHitTarget.GetGUID()); + AuraApplication aurApp = HitAura.GetApplicationOfTarget(_spellHitTarget.GetGUID()); if (aurApp != null) { // only apply unapplied effects (for reapply case)