Core/Spells: fix delayed hit aura crash

Port From (https://github.com/TrinityCore/TrinityCore/commit/c8d7289245c0d60f25f355452574c1258baa7380)
This commit is contained in:
hondacrx
2021-09-21 18:53:17 -04:00
parent d450d62adb
commit 8a1cfbaeb1
+6 -2
View File
@@ -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)