Core/Unit: Spell focusing now no longer nonsensical. HasSpellFocus always const. Error logs for various stuff.

Port From (https://github.com/TrinityCore/TrinityCore/commit/14c38a1c529e634b068a67b3e7475ddcf599086b)
This commit is contained in:
hondacrx
2022-01-02 19:49:21 -05:00
parent 82d3e3d8f4
commit 92c90bf777
6 changed files with 76 additions and 91 deletions
+4 -4
View File
@@ -2343,9 +2343,9 @@ namespace Game.Spells
if (!(m_spellInfo.IsNextMeleeSwingSpell() || IsAutoRepeat()))
{
if (m_targets.GetObjectTarget() && m_caster != m_targets.GetObjectTarget())
m_caster.ToCreature().SetSpellFocusTarget(this, m_targets.GetObjectTarget());
m_caster.ToCreature().SetSpellFocus(this, m_targets.GetObjectTarget());
else if (m_spellInfo.HasAttribute(SpellAttr5.DontTurnDuringCast))
m_caster.ToCreature().SetSpellFocusTarget(this, null);
m_caster.ToCreature().SetSpellFocus(this, null);
}
}
@@ -3998,8 +3998,8 @@ namespace Game.Spells
{
Creature creatureCaster = unitCaster.ToCreature();
if (creatureCaster != null)
if (!creatureCaster.HandleSpellFocus(this))
creatureCaster.SetSpellFocusTarget(this, Global.ObjAccessor.GetWorldObject(creatureCaster, target.TargetGUID));
if (!creatureCaster.HasSpellFocus())
creatureCaster.SetSpellFocus(this, Global.ObjAccessor.GetWorldObject(creatureCaster, target.TargetGUID));
}
}
}