fix(Core/Spells): cache reflection target information for reflected thunderstorm direction (#23762)

This commit is contained in:
thomasjteachey
2025-11-21 00:17:52 -05:00
committed by GitHub
parent 01ebb1f193
commit a0f8f34ded
3 changed files with 42 additions and 1 deletions

View File

@@ -5013,7 +5013,24 @@ void Spell::EffectKnockBack(SpellEffIndex effIndex)
return;
float x, y;
if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_KNOCK_BACK_DEST)
Unit* reflectionSource = m_reflectionTarget;
if (!reflectionSource && !m_reflectionTargetGuid.IsEmpty())
{
if (Unit* resolvedSource = ObjectAccessor::GetUnit(*m_caster, m_reflectionTargetGuid))
reflectionSource = resolvedSource;
}
if (reflectionSource)
{
reflectionSource->GetPosition(x, y);
}
else if (!m_reflectionTargetGuid.IsEmpty())
{
x = m_reflectionTargetPosition.GetPositionX();
y = m_reflectionTargetPosition.GetPositionY();
}
else if (m_spellInfo->Effects[effIndex].Effect == SPELL_EFFECT_KNOCK_BACK_DEST)
{
if (m_targets.HasDst())
destTarget->GetPosition(x, y);