aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorccrs <ccrs@users.noreply.github.com>2019-08-03 17:53:22 +0200
committerShauren <shauren.trinity@gmail.com>2021-12-18 00:29:38 +0100
commita58881d6dac1975b77abf361c5dc5ffcd755d2be (patch)
treec9f10d648eb80248958f19b0a763ee03125a42f6
parent0b77a48ec50883d9119297c808493a1257f99988 (diff)
Core/Unit: rename more methods
Workaround prework till actual facing system rework arrives (cherry picked from commit 85ad0befc51879627f865c86a6b415ca12401fe3)
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp8
-rw-r--r--src/server/game/Entities/Creature/Creature.h4
-rw-r--r--src/server/game/Spells/Spell.cpp12
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp2
4 files changed, 13 insertions, 13 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 8995f9229d8..757fabad2fd 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -2116,7 +2116,7 @@ void Creature::setDeathState(DeathState s)
SaveRespawnTime();
- ReleaseFocus(nullptr, false); // remove spellcast focus
+ ReleaseSpellFocus(nullptr, false); // remove spellcast focus
DoNotReacquireTarget(); // cancel delayed re-target
SetTarget(ObjectGuid::Empty); // drop target - dead mobs shouldn't ever target things
@@ -3200,7 +3200,7 @@ void Creature::SetTarget(ObjectGuid const& guid)
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::Target), guid);
}
-void Creature::FocusTarget(Spell const* focusSpell, WorldObject const* target)
+void Creature::SetSpellFocusTarget(Spell const* focusSpell, WorldObject const* target)
{
// already focused
if (m_focusSpell)
@@ -3282,7 +3282,7 @@ bool Creature::HandleSpellFocus(Spell const* focusSpell, bool withDelay)
{
if (!IsAlive()) // dead creatures cannot focus
{
- ReleaseFocus(nullptr, false);
+ ReleaseSpellFocus(nullptr, false);
return false;
}
@@ -3303,7 +3303,7 @@ bool Creature::HandleSpellFocus(Spell const* focusSpell, bool withDelay)
return true;
}
-void Creature::ReleaseFocus(Spell const* focusSpell, bool withDelay)
+void Creature::ReleaseSpellFocus(Spell const* focusSpell, bool withDelay)
{
if (!m_focusSpell)
return;
diff --git a/src/server/game/Entities/Creature/Creature.h b/src/server/game/Entities/Creature/Creature.h
index 97952f89bca..369f885a28c 100644
--- a/src/server/game/Entities/Creature/Creature.h
+++ b/src/server/game/Entities/Creature/Creature.h
@@ -350,9 +350,9 @@ class TC_GAME_API Creature : public Unit, public GridObject<Creature>, public Ma
void SetTarget(ObjectGuid const& guid) override;
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);
+ void SetSpellFocusTarget(Spell const* focusSpell, WorldObject const* target);
bool HandleSpellFocus(Spell const* focusSpell = nullptr, bool withDelay = false) override;
- void ReleaseFocus(Spell const* focusSpell = nullptr, bool withDelay = true);
+ void ReleaseSpellFocus(Spell const* focusSpell = nullptr, bool withDelay = true);
bool IsMovementPreventedByCasting() const override;
diff --git a/src/server/game/Spells/Spell.cpp b/src/server/game/Spells/Spell.cpp
index f6925e947c5..813a68ce6ba 100644
--- a/src/server/game/Spells/Spell.cpp
+++ b/src/server/game/Spells/Spell.cpp
@@ -3167,9 +3167,9 @@ SpellCastResult Spell::prepare(SpellCastTargets const& targets, AuraEffect const
if (!(m_spellInfo->IsNextMeleeSwingSpell() || IsAutoRepeat()))
{
if (m_targets.GetObjectTarget() && m_caster != m_targets.GetObjectTarget())
- m_caster->ToCreature()->FocusTarget(this, m_targets.GetObjectTarget());
+ m_caster->ToCreature()->SetSpellFocusTarget(this, m_targets.GetObjectTarget());
else if (m_spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST))
- m_caster->ToCreature()->FocusTarget(this, nullptr);
+ m_caster->ToCreature()->SetSpellFocusTarget(this, nullptr);
}
}
@@ -3407,7 +3407,7 @@ void Spell::_cast(bool skipCheck)
}
// if the spell allows the creature to turn while casting, then adjust server-side orientation to face the target now
- // client-side orientation is handled by the client itself, as the cast target is targeted due to Creature::FocusTarget
+ // client-side orientation is handled by the client itself, as the cast target is targeted due to Creature::SetSpellFocusTarget
if (m_caster->GetTypeId() == TYPEID_UNIT && !m_caster->ToUnit()->HasUnitFlag(UNIT_FLAG_POSSESSED))
if (!m_spellInfo->HasAttribute(SPELL_ATTR5_DONT_TURN_DURING_CAST))
if (WorldObject* objTarget = m_targets.GetObjectTarget())
@@ -3482,7 +3482,7 @@ void Spell::_cast(bool skipCheck)
if (!m_spellInfo->IsChanneled())
if (Creature* creatureCaster = m_caster->ToCreature())
- creatureCaster->ReleaseFocus(this);
+ creatureCaster->ReleaseSpellFocus(this);
// Okay, everything is prepared. Now we need to distinguish between immediate and evented delayed spells
if ((m_spellInfo->HasHitDelay() && !m_spellInfo->IsChanneled()) || m_spellInfo->HasAttribute(SPELL_ATTR4_UNK4))
@@ -3940,7 +3940,7 @@ void Spell::finish(bool ok)
}
if (Creature* creatureCaster = unitCaster->ToCreature())
- creatureCaster->ReleaseFocus(this);
+ creatureCaster->ReleaseSpellFocus(this);
if (!ok)
return;
@@ -4779,7 +4779,7 @@ void Spell::SendChannelStart(uint32 duration)
if(target.TargetGUID != unitCaster->GetGUID())
if (Creature* creatureCaster = unitCaster->ToCreature())
if (!creatureCaster->HandleSpellFocus(this))
- creatureCaster->FocusTarget(this, ObjectAccessor::GetWorldObject(*creatureCaster, target.TargetGUID));
+ creatureCaster->SetSpellFocusTarget(this, ObjectAccessor::GetWorldObject(*creatureCaster, target.TargetGUID));
}
for (GOTargetInfo const& target : m_UniqueGOTargetInfo)
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
index 4d9c3279761..c9f65448fb3 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/boss_thorim.cpp
@@ -1802,7 +1802,7 @@ class spell_thorim_lightning_charge : public SpellScriptLoader
{
/// @workaround: focus target is not working because spell is triggered and instant
if (Creature* creature = GetCaster()->ToCreature())
- creature->FocusTarget(GetSpell(), GetExplTargetWorldObject());
+ creature->SetSpellFocusTarget(GetSpell(), GetExplTargetWorldObject());
}
void HandleCharge()