From 0ca73248cd701beb51b80aa036710c1e8c0ec586 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 12 May 2020 23:51:55 -0400 Subject: [PATCH] Core/Spell: fix creature focus with channeled spells Port From (https://github.com/TrinityCore/TrinityCore/commit/e3eca0c26410a6c9dc7fbef46ffb938cdd0901bc) --- Source/Game/Spells/Spell.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Source/Game/Spells/Spell.cs b/Source/Game/Spells/Spell.cs index 9426cee6c..e1198f43d 100644 --- a/Source/Game/Spells/Spell.cs +++ b/Source/Game/Spells/Spell.cs @@ -2807,10 +2807,6 @@ namespace Game.Spells SetExecutedCurrently(false); - Creature creatureCaster = m_caster.ToCreature(); - if (creatureCaster) - creatureCaster.ReleaseFocus(this); - if (!m_originalCaster) return; @@ -3983,8 +3979,18 @@ namespace Game.Spells m_timer = (int)duration; foreach (TargetInfo target in m_UniqueTargetInfo) + { m_caster.AddChannelObject(target.targetGUID); + if (m_UniqueTargetInfo.Count == 1 && m_UniqueGOTargetInfo.Empty()) + { + Creature creatureCaster = m_caster.ToCreature(); + if (creatureCaster != null) + if (!creatureCaster.IsFocusing(this)) + creatureCaster.FocusTarget(this, Global.ObjAccessor.GetWorldObject(creatureCaster, target.targetGUID)); + } + } + foreach (GOTargetInfo target in m_UniqueGOTargetInfo) m_caster.AddChannelObject(target.targetGUID);