Core/Spells: fix issues with delayed spells and auras

Port From (https://github.com/TrinityCore/TrinityCore/commit/87486cecffa9752c59cf8766757f79d2e528d152)
This commit is contained in:
hondacrx
2021-11-15 23:14:01 -05:00
parent 333179e1e9
commit c5ed2f5a97
+1 -9
View File
@@ -2012,15 +2012,7 @@ namespace Game.Spells
if (caster != null)
{
// delayed spells with multiple targets need to create a new aura object, otherwise we'll access a deleted aura
if (m_spellInfo.HasHitDelay() && !m_spellInfo.IsChanneled())
{
spellAura = null;
Aura aura = unit.GetAura(m_spellInfo.Id, caster.GetGUID(), m_CastItem ? m_CastItem.GetGUID() : ObjectGuid.Empty, aura_effmask);
if (aura != null)
spellAura = aura.ToUnitAura();
}
if (spellAura == null)
if (spellAura == null || (m_spellInfo.HasHitDelay() && !m_spellInfo.IsChanneled()))
{
bool resetPeriodicTimer = !_triggeredCastFlags.HasFlag(TriggerCastFlags.DontResetPeriodicTimer);
uint allAuraEffectMask = Aura.BuildEffectMaskForOwner(m_spellInfo, SpellConst.MaxEffectMask, unit);