Core/Unit: rename more things

Port From (https://github.com/TrinityCore/TrinityCore/commit/4db13853f7707c168c1297e662f9e6085d2f01be)
This commit is contained in:
hondacrx
2022-01-02 19:28:27 -05:00
parent a2a2eb3581
commit 6a42e70544
2 changed files with 25 additions and 25 deletions
@@ -28,10 +28,10 @@ namespace Game.Entities
CreatureData m_creatureData; CreatureData m_creatureData;
Spell _focusSpell; // Locks the target during spell cast for proper facing Spell _focusSpell; // Locks the target during spell cast for proper facing
uint _focusDelay; uint _spellFocusDelay;
bool m_shouldReacquireTarget; bool _shouldReacquireSpellFocusTarget;
ObjectGuid m_suppressedTarget; // Stores the creature's "real" target while casting ObjectGuid _suppressedSpellFocusTarget; // Stores the creature's "real" target while casting
float m_suppressedOrientation; // Stores the creature's "real" orientation while casting float _suppressedSpellFocusOrientation; // Stores the creature's "real" orientation while casting
long _lastDamagedTime; // Part of Evade mechanics long _lastDamagedTime; // Part of Evade mechanics
MultiMap<byte, byte> m_textRepeat = new(); MultiMap<byte, byte> m_textRepeat = new();
+21 -21
View File
@@ -532,23 +532,23 @@ namespace Game.Entities
GetThreatManager().Update(diff); GetThreatManager().Update(diff);
if (m_shouldReacquireTarget && !HandleSpellFocus(null, true)) if (_shouldReacquireSpellFocusTarget && !HandleSpellFocus(null, true))
{ {
SetTarget(m_suppressedTarget); SetTarget(_suppressedSpellFocusTarget);
if (!HasUnitFlag2(UnitFlags2.DisableTurn)) if (!HasUnitFlag2(UnitFlags2.DisableTurn))
{ {
if (!m_suppressedTarget.IsEmpty()) if (!_suppressedSpellFocusTarget.IsEmpty())
{ {
WorldObject objTarget = Global.ObjAccessor.GetWorldObject(this, m_suppressedTarget); WorldObject objTarget = Global.ObjAccessor.GetWorldObject(this, _suppressedSpellFocusTarget);
if (objTarget) if (objTarget)
SetFacingToObject(objTarget); SetFacingToObject(objTarget);
} }
else else
SetFacingTo(m_suppressedOrientation); SetFacingTo(_suppressedSpellFocusOrientation);
} }
m_shouldReacquireTarget = false; _shouldReacquireSpellFocusTarget = false;
} }
// periodic check to see if the creature has passed an evade boundary // periodic check to see if the creature has passed an evade boundary
@@ -2920,7 +2920,7 @@ namespace Game.Entities
public override void SetTarget(ObjectGuid guid) public override void SetTarget(ObjectGuid guid)
{ {
if (HandleSpellFocus(null, true)) if (HandleSpellFocus(null, true))
m_suppressedTarget = guid; _suppressedSpellFocusTarget = guid;
else else
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.Target), guid); SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.Target), guid);
} }
@@ -2955,8 +2955,8 @@ namespace Game.Entities
// store pre-cast values for target and orientation (used to later restore) // store pre-cast values for target and orientation (used to later restore)
if (!HandleSpellFocus(null, true)) if (!HandleSpellFocus(null, true))
{ // only overwrite these fields if we aren't transitioning from one spell focus to another { // only overwrite these fields if we aren't transitioning from one spell focus to another
m_suppressedTarget = GetTarget(); _suppressedSpellFocusTarget = GetTarget();
m_suppressedOrientation = GetOrientation(); _suppressedSpellFocusOrientation = GetOrientation();
} }
_focusSpell = focusSpell; _focusSpell = focusSpell;
@@ -3014,11 +3014,11 @@ namespace Game.Entities
if (!_focusSpell) if (!_focusSpell)
{ {
if (!withDelay || _focusDelay == 0) if (!withDelay || _spellFocusDelay == 0)
return false; return false;
if (Time.GetMSTimeDiffToNow(_focusDelay) > 1000) // @todo figure out if we can get rid of this magic number somehow if (Time.GetMSTimeDiffToNow(_spellFocusDelay) > 1000) // @todo figure out if we can get rid of this magic number somehow
{ {
_focusDelay = 0; // save checks in the future _spellFocusDelay = 0; // save checks in the future
return false; return false;
} }
} }
@@ -3037,15 +3037,15 @@ namespace Game.Entities
if (IsPet() && !HasUnitFlag2(UnitFlags2.DisableTurn))// player pets do not use delay system if (IsPet() && !HasUnitFlag2(UnitFlags2.DisableTurn))// player pets do not use delay system
{ {
SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.Target), m_suppressedTarget); SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.Target), _suppressedSpellFocusTarget);
if (!m_suppressedTarget.IsEmpty()) if (!_suppressedSpellFocusTarget.IsEmpty())
{ {
WorldObject objTarget = Global.ObjAccessor.GetWorldObject(this, m_suppressedTarget); WorldObject objTarget = Global.ObjAccessor.GetWorldObject(this, _suppressedSpellFocusTarget);
if (objTarget) if (objTarget)
SetFacingToObject(objTarget, false); SetFacingToObject(objTarget, false);
} }
else else
SetFacingTo(m_suppressedOrientation, false); SetFacingTo(_suppressedSpellFocusOrientation, false);
} }
else else
// tell the creature that it should reacquire its actual target after the delay expires (this is handled in ::Update) // tell the creature that it should reacquire its actual target after the delay expires (this is handled in ::Update)
@@ -3056,17 +3056,17 @@ namespace Game.Entities
ClearUnitState(UnitState.Focusing); ClearUnitState(UnitState.Focusing);
_focusSpell = null; _focusSpell = null;
_focusDelay = (!IsPet() && withDelay) ? GameTime.GetGameTimeMS() : 0; // don't allow re-target right away to prevent visual bugs _spellFocusDelay = (!IsPet() && withDelay) ? GameTime.GetGameTimeMS() : 0; // don't allow re-target right away to prevent visual bugs
} }
public void MustReacquireTarget() { m_shouldReacquireTarget = true; } // flags the Creature for forced (client displayed) target reacquisition in the next Update call public void MustReacquireTarget() { _shouldReacquireSpellFocusTarget = true; } // flags the Creature for forced (client displayed) target reacquisition in the next Update call
public void DoNotReacquireTarget() public void DoNotReacquireTarget()
{ {
m_shouldReacquireTarget = false; _shouldReacquireSpellFocusTarget = false;
m_suppressedTarget = ObjectGuid.Empty; _suppressedSpellFocusTarget = ObjectGuid.Empty;
SetTarget(ObjectGuid.Empty); SetTarget(ObjectGuid.Empty);
m_suppressedOrientation = 0.0f; _suppressedSpellFocusOrientation = 0.0f;
} }
public ulong GetSpawnId() { return m_spawnId; } public ulong GetSpawnId() { return m_spawnId; }