fix(Core/Spell): Fix crash in Rogue T10 4P Bonus (#18413)

This commit is contained in:
Anton Popovichenko
2024-02-25 23:55:32 +01:00
committed by GitHub
parent 42cde6286f
commit 22f2a8f731

View File

@@ -768,13 +768,12 @@ class spell_gen_proc_not_self : public AuraScript
if (Unit* caster = GetCaster()) if (Unit* caster = GetCaster())
if (Unit* target = eventInfo.GetActionTarget()) if (Unit* target = eventInfo.GetActionTarget())
{ {
ObjectGuid targetGUID = target->GetGUID();
uint32 spellID = aurEff->GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell; uint32 spellID = aurEff->GetSpellInfo()->Effects[aurEff->GetEffIndex()].TriggerSpell;
caster->m_Events.AddEventAtOffset([caster, target, spellID]() caster->m_Events.AddEventAtOffset([caster, targetGUID, spellID]()
{ {
if (target) if (Unit *target = ObjectAccessor::GetUnit(*caster, targetGUID))
{
caster->CastSpell(target, spellID, true); caster->CastSpell(target, spellID, true);
}
}, 100ms); }, 100ms);
} }
} }