aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2019-08-03 17:45:06 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-18 00:25:14 +0100
commitbe4ed9152c1a9c3dab9949eb36d867b763603f60 (patch)
tree72d320d869b1a8749b28812100d02a820a542b85
parentd2a3bae8627b5577c9372d0a549fb1d2fe2cb594 (diff)
Core/Unit: rename IsFocusing method
Workaround prework till actual facing system rework arrives (cherry picked from commit ec9f15a5fff7830bf2aebc517654784a6d54bb74)
-rw-r--r--src/server/game/AI/CreatureAI.cpp2
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp12
-rw-r--r--src/server/game/Entities/Creature/Creature.h2
-rw-r--r--src/server/game/Entities/Unit/Unit.h2
-rw-r--r--src/server/game/Handlers/PetHandler.cpp4
-rw-r--r--src/server/game/Spells/Spell.cpp2
-rw-r--r--src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp2
-rw-r--r--src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp2
8 files changed, 14 insertions, 14 deletions
diff --git a/src/server/game/AI/CreatureAI.cpp b/src/server/game/AI/CreatureAI.cpp
index bb16389c932..8f09c34fbc8 100644
--- a/src/server/game/AI/CreatureAI.cpp
+++ b/src/server/game/AI/CreatureAI.cpp
@@ -256,7 +256,7 @@ bool CreatureAI::UpdateVictim()
if (!me->HasReactState(REACT_PASSIVE))
{
if (Unit* victim = me->SelectVictim())
- if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim())
+ if (!me->HandleSpellFocus(nullptr, true) && victim != me->GetVictim())
AttackStart(victim);
return me->GetVictim() != nullptr;
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index d1c76f3aa6e..8995f9229d8 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -801,7 +801,7 @@ void Creature::Update(uint32 diff)
GetThreatManager().Update(diff);
- if (m_shouldReacquireTarget && !IsFocusing(nullptr, true))
+ if (m_shouldReacquireTarget && !HandleSpellFocus(nullptr, true))
{
SetTarget(m_suppressedTarget);
@@ -1220,7 +1220,7 @@ Unit* Creature::SelectVictim()
if (target && _IsTargetAcceptable(target) && CanCreatureAttack(target))
{
- if (!IsFocusing(nullptr, true))
+ if (!HandleSpellFocus(nullptr, true))
SetInFront(target);
return target;
}
@@ -3194,7 +3194,7 @@ void Creature::SetDisplayFromModel(uint32 modelIdx)
void Creature::SetTarget(ObjectGuid const& guid)
{
- if (IsFocusing(nullptr, true))
+ if (HandleSpellFocus(nullptr, true))
m_suppressedTarget = guid;
else
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::Target), guid);
@@ -3228,7 +3228,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 = GetTarget();
m_suppressedOrientation = GetOrientation();
@@ -3278,7 +3278,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
{
@@ -3345,7 +3345,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 aadb0736f7f..97952f89bca 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -351,7 +351,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; SetTarget(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;
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 28f9f156cec..cd7d690e989 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -1503,7 +1503,7 @@ class TC_GAME_API Unit : public WorldObject
virtual SpellInfo const* GetCastSpellInfo(SpellInfo const* spellInfo) const;
uint32 GetCastSpellXSpellVisualId(SpellInfo const* spellInfo) const override;
- virtual bool IsFocusing(Spell const* /*focusSpell*/ = nullptr, bool /*withDelay*/ = false) { return false; }
+ virtual bool HandleSpellFocus(Spell const* /*focusSpell*/ = nullptr, bool /*withDelay*/ = false) { return false; }
virtual bool IsMovementPreventedByCasting() const;
bool CanCastSpellWhileMoving(SpellInfo const* spellInfo) const;
diff --git a/src/server/game/Handlers/PetHandler.cpp b/src/server/game/Handlers/PetHandler.cpp
index 4a4cda508f1..79c30717004 100644
--- a/src/server/game/Handlers/PetHandler.cpp
+++ b/src/server/game/Handlers/PetHandler.cpp
@@ -337,14 +337,14 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
{
if (unit_target)
{
- if (!pet->IsFocusing())
+ if (!pet->HandleSpellFocus())
pet->SetInFront(unit_target);
if (Player* player = unit_target->ToPlayer())
pet->SendUpdateToPlayer(player);
}
else if (Unit* unit_target2 = spell->m_targets.GetUnitTarget())
{
- if (!pet->IsFocusing())
+ if (!pet->HandleSpellFocus())
pet->SetInFront(unit_target2);
if (Player* player = unit_target2->ToPlayer())
pet->SendUpdateToPlayer(player);
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index a13a22044c9..f6925e947c5 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -4778,7 +4778,7 @@ void Spell::SendChannelStart(uint32 duration)
if (m_UniqueTargetInfo.size() == 1 && m_UniqueGOTargetInfo.empty())
if(target.TargetGUID != unitCaster->GetGUID())
if (Creature* creatureCaster = unitCaster->ToCreature())
- if (!creatureCaster->IsFocusing(this))
+ if (!creatureCaster->HandleSpellFocus(this))
creatureCaster->FocusTarget(this, ObjectAccessor::GetWorldObject(*creatureCaster, target.TargetGUID));
}
diff --git a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
index 06940cc0c0e..e22e075624a 100644
--- a/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
+++ b/src/server/scripts/Northrend/FrozenHalls/HallsOfReflection/halls_of_reflection.cpp
@@ -1363,7 +1363,7 @@ class npc_the_lich_king_escape_hor : public CreatureScript
if (!me->HasReactState(REACT_PASSIVE))
{
if (Unit* victim = me->SelectVictim())
- if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim())
+ if (!me->HandleSpellFocus(nullptr, true) && victim != me->GetVictim())
AttackStart(victim);
return me->GetVictim() != nullptr;
}
diff --git a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
index fc5fdbceb4d..4eedcff833e 100644
--- a/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
+++ b/src/server/scripts/Northrend/IcecrownCitadel/boss_icecrown_gunship_battle.cpp
@@ -630,7 +630,7 @@ protected:
if (!me->HasReactState(REACT_PASSIVE))
{
if (Unit* victim = me->SelectVictim())
- if (!me->IsFocusing(nullptr, true) && victim != me->GetVictim())
+ if (!me->HandleSpellFocus(nullptr, true) && victim != me->GetVictim())
AttackStart(victim);
return me->GetVictim() != nullptr;