diff options
| author | ccrs <ccrs@users.noreply.github.com> | 2019-08-03 17:45:06 +0200 |
|---|---|---|
| committer | ccrs <ccrs@users.noreply.github.com> | 2019-08-03 17:45:06 +0200 |
| commit | ec9f15a5fff7830bf2aebc517654784a6d54bb74 (patch) | |
| tree | 913351867c6e4153321b1bdb7eb0eadb8055bbb0 /src/server/game/Entities/Creature | |
| parent | 7e929f532e3dc471dcb8d036a4757c8c525d8e6f (diff) | |
Core/Unit: rename IsFocusing method
Workaround prework till actual facing system rework arrives
Diffstat (limited to 'src/server/game/Entities/Creature')
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 12 | ||||
| -rw-r--r-- | src/server/game/Entities/Creature/Creature.h | 2 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index 5731e3a7437..dcc10f978f7 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -735,7 +735,7 @@ void Creature::Update(uint32 diff) GetThreatManager().Update(diff); - if (m_shouldReacquireTarget && !IsFocusing(nullptr, true)) + if (m_shouldReacquireTarget && !HandleSpellFocus(nullptr, true)) { SetTarget(m_suppressedTarget); @@ -1120,7 +1120,7 @@ Unit* Creature::SelectVictim() if (target && _IsTargetAcceptable(target) && CanCreatureAttack(target)) { - if (!IsFocusing(nullptr, true)) + if (!HandleSpellFocus(nullptr, true)) SetInFront(target); return target; } @@ -3032,7 +3032,7 @@ void Creature::SetDisplayId(uint32 modelId) void Creature::SetTarget(ObjectGuid guid) { - if (IsFocusing(nullptr, true)) + if (HandleSpellFocus(nullptr, true)) m_suppressedTarget = guid; else SetGuidValue(UNIT_FIELD_TARGET, guid); @@ -3066,7 +3066,7 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target) return; // store pre-cast values for target and orientation (used to later restore) - if (!IsFocusing(nullptr, true)) + if (!HandleSpellFocus(nullptr, true)) { // only overwrite these fields if we aren't transitioning from one spell focus to another m_suppressedTarget = GetGuidValue(UNIT_FIELD_TARGET); m_suppressedOrientation = GetOrientation(); @@ -3117,7 +3117,7 @@ void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target) AddUnitState(UNIT_STATE_FOCUSING); } -bool Creature::IsFocusing(Spell const* focusSpell, bool withDelay) +bool Creature::HandleSpellFocus(Spell const* focusSpell, bool withDelay) { if (!IsAlive()) // dead creatures cannot focus { @@ -3184,7 +3184,7 @@ bool Creature::IsMovementPreventedByCasting() const return false; } - if (const_cast<Creature*>(this)->IsFocusing(nullptr, true)) + if (const_cast<Creature*>(this)->HandleSpellFocus(nullptr, true)) return true; if (HasUnitState(UNIT_STATE_CASTING)) diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h index 90f69dcb5a1..e9e461fa33f 100644 --- a/src/server/game/Entities/Creature/Creature.h +++ b/src/server/game/Entities/Creature/Creature.h @@ -343,7 +343,7 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma void MustReacquireTarget() { m_shouldReacquireTarget = true; } // flags the Creature for forced (client displayed) target reacquisition in the next ::Update call void DoNotReacquireTarget() { m_shouldReacquireTarget = false; m_suppressedTarget = ObjectGuid::Empty; SetGuidValue(UNIT_FIELD_TARGET, ObjectGuid::Empty); m_suppressedOrientation = 0.0f; } void FocusTarget(Spell const* focusSpell, WorldObject const* target); - bool IsFocusing(Spell const* focusSpell = nullptr, bool withDelay = false) override; + bool HandleSpellFocus(Spell const* focusSpell = nullptr, bool withDelay = false) override; void ReleaseFocus(Spell const* focusSpell = nullptr, bool withDelay = true); bool IsMovementPreventedByCasting() const override; |
