Core/Spell: fix creature focus with channeled spells
Port From (https://github.com/TrinityCore/TrinityCore/commit/e3eca0c26410a6c9dc7fbef46ffb938cdd0901bc)
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user