mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-18 00:18:43 +01:00
Core/Spells: Use the UNIT_FIELD_CHANNEL_OBJECT field instead of Spell::m_targets to select the channel targets of a triggered spell.
Closes #7246
This commit is contained in:
@@ -916,7 +916,7 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa
|
||||
{
|
||||
case TARGET_UNIT_CHANNEL_TARGET:
|
||||
{
|
||||
WorldObject* target = ObjectAccessor::GetUnit(*m_caster, channeledSpell->m_targets.GetUnitTargetGUID());
|
||||
WorldObject* target = ObjectAccessor::GetUnit(*m_caster, m_originalCaster->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT));
|
||||
CallScriptObjectTargetSelectHandlers(target, effIndex);
|
||||
// unit target may be no longer avalible - teleported out of map for example
|
||||
if (target && target->ToUnit())
|
||||
@@ -928,7 +928,7 @@ void Spell::SelectImplicitChannelTargets(SpellEffIndex effIndex, SpellImplicitTa
|
||||
case TARGET_DEST_CHANNEL_TARGET:
|
||||
if (channeledSpell->m_targets.HasDst())
|
||||
m_targets.SetDst(channeledSpell->m_targets);
|
||||
else if (WorldObject* target = ObjectAccessor::GetWorldObject(*m_caster, channeledSpell->m_targets.GetObjectTargetGUID()))
|
||||
else if (WorldObject* target = ObjectAccessor::GetWorldObject(*m_caster, m_originalCaster->GetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT)))
|
||||
{
|
||||
CallScriptObjectTargetSelectHandlers(target, effIndex);
|
||||
if (target)
|
||||
|
||||
Reference in New Issue
Block a user