Core/Unit: rename IsFocusing method
Port From (https://github.com/TrinityCore/TrinityCore/commit/be4ed9152c1a9c3dab9949eb36d867b763603f60)
This commit is contained in:
@@ -254,7 +254,7 @@ namespace Game.AI
|
||||
{
|
||||
Unit victim = me.SelectVictim();
|
||||
if (victim != null)
|
||||
if (!me.IsFocusing(null, true) && victim != me.GetVictim())
|
||||
if (!me.HandleSpellFocus(null, true) && victim != me.GetVictim())
|
||||
AttackStart(victim);
|
||||
|
||||
return me.GetVictim() != null;
|
||||
|
||||
@@ -532,7 +532,7 @@ namespace Game.Entities
|
||||
|
||||
GetThreatManager().Update(diff);
|
||||
|
||||
if (m_shouldReacquireTarget && !IsFocusing(null, true))
|
||||
if (m_shouldReacquireTarget && !HandleSpellFocus(null, true))
|
||||
{
|
||||
SetTarget(m_suppressedTarget);
|
||||
|
||||
@@ -932,7 +932,7 @@ namespace Game.Entities
|
||||
|
||||
if (target && _IsTargetAcceptable(target) && CanCreatureAttack(target))
|
||||
{
|
||||
if (!IsFocusing(null, true))
|
||||
if (!HandleSpellFocus(null, true))
|
||||
SetInFront(target);
|
||||
return target;
|
||||
}
|
||||
@@ -1121,7 +1121,7 @@ namespace Game.Entities
|
||||
return true;
|
||||
}
|
||||
|
||||
if (IsFocusing(null, true))
|
||||
if (HandleSpellFocus(null, true))
|
||||
return true;
|
||||
|
||||
if (HasUnitState(UnitState.Casting))
|
||||
@@ -2919,7 +2919,7 @@ namespace Game.Entities
|
||||
|
||||
public override void SetTarget(ObjectGuid guid)
|
||||
{
|
||||
if (IsFocusing(null, true))
|
||||
if (HandleSpellFocus(null, true))
|
||||
m_suppressedTarget = guid;
|
||||
else
|
||||
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.Target), guid);
|
||||
@@ -2953,7 +2953,7 @@ namespace Game.Entities
|
||||
return;
|
||||
|
||||
// store pre-cast values for target and orientation (used to later restore)
|
||||
if (!IsFocusing(null, true))
|
||||
if (!HandleSpellFocus(null, true))
|
||||
{ // only overwrite these fields if we aren't transitioning from one spell focus to another
|
||||
m_suppressedTarget = GetTarget();
|
||||
m_suppressedOrientation = GetOrientation();
|
||||
@@ -3001,7 +3001,7 @@ namespace Game.Entities
|
||||
AddUnitState(UnitState.Focusing);
|
||||
}
|
||||
|
||||
public override bool IsFocusing(Spell focusSpell = null, bool withDelay = false)
|
||||
public override bool HandleSpellFocus(Spell focusSpell = null, bool withDelay = false)
|
||||
{
|
||||
if (!IsAlive()) // dead creatures cannot focus
|
||||
{
|
||||
|
||||
@@ -1041,7 +1041,7 @@ namespace Game.Entities
|
||||
return 0;
|
||||
}
|
||||
|
||||
public virtual bool IsFocusing(Spell focusSpell = null, bool withDelay = false) { return false; }
|
||||
public virtual bool HandleSpellFocus(Spell focusSpell = null, bool withDelay = false) { return false; }
|
||||
|
||||
/// <summary>
|
||||
/// Check if our current channel spell has attribute SPELL_ATTR5_CAN_CHANNEL_WHEN_MOVING
|
||||
|
||||
@@ -327,7 +327,7 @@ namespace Game
|
||||
Unit unit_target2 = spell.m_targets.GetUnitTarget();
|
||||
if (unit_target)
|
||||
{
|
||||
if (!pet.IsFocusing())
|
||||
if (!pet.HandleSpellFocus())
|
||||
pet.SetInFront(unit_target);
|
||||
Player player = unit_target.ToPlayer();
|
||||
if (player)
|
||||
@@ -335,7 +335,7 @@ namespace Game
|
||||
}
|
||||
else if (unit_target2)
|
||||
{
|
||||
if (!pet.IsFocusing())
|
||||
if (!pet.HandleSpellFocus())
|
||||
pet.SetInFront(unit_target2);
|
||||
Player player = unit_target2.ToPlayer();
|
||||
if (player)
|
||||
|
||||
@@ -3998,7 +3998,7 @@ namespace Game.Spells
|
||||
{
|
||||
Creature creatureCaster = unitCaster.ToCreature();
|
||||
if (creatureCaster != null)
|
||||
if (!creatureCaster.IsFocusing(this))
|
||||
if (!creatureCaster.HandleSpellFocus(this))
|
||||
creatureCaster.FocusTarget(this, Global.ObjAccessor.GetWorldObject(creatureCaster, target.TargetGUID));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user