mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-19 11:55:43 +00:00
refactor(Core): Rename ...Manager to ...Mgr (#6910)
* Rename MapManager.h to MapMgr.h * Rename BanManager.h to BanMgr.h * Rename MapManager.cpp to MapMgr.cpp * Rename BanManager.cpp to BanMgr.cpp * Rename MapRefManager.h to MapRefMgr.h * Rename ThreatManager.h to ThreatMgr.h * Rename GridRefManager.h to GridRefMgr.h * Rename ThreatManager.cpp to ThreatMgr.cpp * Rename GroupRefManager.h to GroupRefMgr.h * Rename HostileRefManager.h to HostileRefMgr.h * Rename HostileRefManager.cpp to HostileRefMgr.cpp * Rename MMapManager.h to MMapMgr.h * Rename FollowerRefManager.h to FollowerRefMgr.h * Rename VMapManager2.h to VMapMgr2.h * Rename IVMapManager.h to IVMapMgr.h * Rename MMapManager.cpp to MMapMgr.cpp * Rename VMapManager2.cpp to VMapMgr2.cpp * Rename RefManager.h to RefMgr.h * Rename WaypointManager.h to WaypointMgr.h * Rename WaypointManager.cpp to WaypointMgr.cpp * Rename MPQManager.h to MPQMgr.h * Rename MPQManager.cpp to MPQMgr.cpp * Rename IMMAPManager.h to IMMAPMgr.h * fix build * Update Main.cpp * chore(Core/Misc): Remove toxic language * Revert "chore(Core/Misc): Remove toxic language" * fix build * build
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
#include "InstanceSaveMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "Log.h"
|
||||
#include "MapManager.h"
|
||||
#include "MapMgr.h"
|
||||
#include "MoveSpline.h"
|
||||
#include "MoveSplineInit.h"
|
||||
#include "ObjectAccessor.h"
|
||||
@@ -184,11 +184,11 @@ Unit::Unit(bool isWorldObject) : WorldObject(isWorldObject),
|
||||
m_removedAurasCount(0),
|
||||
i_motionMaster(new MotionMaster(this)),
|
||||
m_regenTimer(0),
|
||||
m_ThreatManager(this),
|
||||
m_ThreatMgr(this),
|
||||
m_vehicle(nullptr),
|
||||
m_vehicleKit(nullptr),
|
||||
m_unitTypeMask(UNIT_MASK_NONE),
|
||||
m_HostileRefManager(this),
|
||||
m_HostileRefMgr(this),
|
||||
m_comboTarget(nullptr)
|
||||
{
|
||||
#ifdef _MSC_VER
|
||||
@@ -400,7 +400,7 @@ void Unit::Update(uint32 p_time)
|
||||
|
||||
_UpdateSpells( p_time );
|
||||
|
||||
if (CanHaveThreatList() && getThreatManager().isNeedUpdateToClient(p_time))
|
||||
if (CanHaveThreatList() && getThreatMgr().isNeedUpdateToClient(p_time))
|
||||
SendThreatListUpdate();
|
||||
|
||||
// update combat timer only for players and pets (only pets with PetAI)
|
||||
@@ -409,7 +409,7 @@ void Unit::Update(uint32 p_time)
|
||||
// Check UNIT_STATE_MELEE_ATTACKING or UNIT_STATE_CHASE (without UNIT_STATE_FOLLOW in this case) so pets can reach far away
|
||||
// targets without stopping half way there and running off.
|
||||
// These flags are reset after target dies or another command is given.
|
||||
if (m_HostileRefManager.isEmpty())
|
||||
if (m_HostileRefMgr.isEmpty())
|
||||
{
|
||||
// m_CombatTimer set at aura start and it will be freeze until aura removing
|
||||
if (m_CombatTimer <= p_time)
|
||||
@@ -8671,7 +8671,7 @@ bool Unit::HandleProcTriggerSpell(Unit* victim, uint32 damage, AuraEffect* trigg
|
||||
return false;
|
||||
|
||||
if (victim && victim->IsAlive())
|
||||
victim->getThreatManager().modifyThreatPercent(this, -10);
|
||||
victim->getThreatMgr().modifyThreatPercent(this, -10);
|
||||
|
||||
basepoints0 = int32(CountPctFromMaxHealth(triggerAmount));
|
||||
trigger_spell_id = 31616;
|
||||
@@ -10549,7 +10549,7 @@ void Unit::EnergizeBySpell(Unit* victim, uint32 spellID, uint32 damage, Powers p
|
||||
if (powerType != POWER_HAPPINESS)
|
||||
{
|
||||
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(spellID);
|
||||
victim->getHostileRefManager().threatAssist(this, float(damage) * 0.5f, spellInfo);
|
||||
victim->getHostileRefMgr().threatAssist(this, float(damage) * 0.5f, spellInfo);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13577,7 +13577,7 @@ void Unit::setDeathState(DeathState s, bool despawn)
|
||||
{
|
||||
CombatStop();
|
||||
DeleteThreatList();
|
||||
getHostileRefManager().deleteReferences();
|
||||
getHostileRefMgr().deleteReferences();
|
||||
ClearComboPointHolders(); // any combo points pointed to unit lost at it death
|
||||
|
||||
if (IsNonMeleeSpellCast(false))
|
||||
@@ -13674,7 +13674,7 @@ void Unit::AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask, Sp
|
||||
// Only mobs can manage threat lists
|
||||
if (CanHaveThreatList() && !HasUnitState(UNIT_STATE_EVADE))
|
||||
{
|
||||
m_ThreatManager.addThreat(victim, fThreat, schoolMask, threatSpell);
|
||||
m_ThreatMgr.addThreat(victim, fThreat, schoolMask, threatSpell);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13682,9 +13682,9 @@ void Unit::AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask, Sp
|
||||
|
||||
void Unit::DeleteThreatList()
|
||||
{
|
||||
if (CanHaveThreatList() && !m_ThreatManager.isThreatListEmpty())
|
||||
if (CanHaveThreatList() && !m_ThreatMgr.isThreatListEmpty())
|
||||
SendClearThreatListOpcode();
|
||||
m_ThreatManager.clearReferences();
|
||||
m_ThreatMgr.clearReferences();
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
@@ -13712,7 +13712,7 @@ void Unit::TauntApply(Unit* taunter)
|
||||
if (creature->IsAIEnabled)
|
||||
creature->AI()->AttackStart(taunter);
|
||||
|
||||
//m_ThreatManager.tauntApply(taunter);
|
||||
//m_ThreatMgr.tauntApply(taunter);
|
||||
}
|
||||
|
||||
//======================================================================
|
||||
@@ -13736,7 +13736,7 @@ void Unit::TauntFadeOut(Unit* taunter)
|
||||
if (!target || target != taunter)
|
||||
return;
|
||||
|
||||
if (m_ThreatManager.isThreatListEmpty())
|
||||
if (m_ThreatMgr.isThreatListEmpty())
|
||||
{
|
||||
if (creature->IsAIEnabled)
|
||||
creature->AI()->EnterEvadeMode();
|
||||
@@ -13776,8 +13776,8 @@ Unit* Creature::SelectVictim()
|
||||
|
||||
if (CanHaveThreatList())
|
||||
{
|
||||
if (!target && !m_ThreatManager.isThreatListEmpty())
|
||||
target = m_ThreatManager.getHostilTarget();
|
||||
if (!target && !m_ThreatMgr.isThreatListEmpty())
|
||||
target = m_ThreatMgr.getHostilTarget();
|
||||
}
|
||||
else if (!HasReactState(REACT_PASSIVE))
|
||||
{
|
||||
@@ -14740,7 +14740,7 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
|
||||
CombatStop();
|
||||
ClearComboPointHolders();
|
||||
DeleteThreatList();
|
||||
getHostileRefManager().deleteReferences();
|
||||
getHostileRefMgr().deleteReferences();
|
||||
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
|
||||
}
|
||||
|
||||
@@ -16882,7 +16882,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
|
||||
|
||||
// Stop attacks
|
||||
victim->CombatStop();
|
||||
victim->getHostileRefManager().deleteReferences();
|
||||
victim->getHostileRefMgr().deleteReferences();
|
||||
|
||||
// restore for use at real death
|
||||
victim->SetUInt32Value(PLAYER_SELF_RES_SPELL, ressSpellId);
|
||||
@@ -17537,7 +17537,7 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type, AuraApplication const* au
|
||||
_charmThreatInfo.clear();
|
||||
|
||||
// Xinef: move invalid threat / hostile references to offline lists
|
||||
ThreatContainer::StorageType threatList = getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType threatList = getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
if (Unit* target = (*itr)->getTarget())
|
||||
_charmThreatInfo[target->GetGUID()] = (*itr)->getThreat() - (*itr)->getTempThreatModifier();
|
||||
@@ -17588,7 +17588,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
|
||||
CastStop();
|
||||
|
||||
CombatStop();
|
||||
getHostileRefManager().deleteReferences();
|
||||
getHostileRefMgr().deleteReferences();
|
||||
DeleteThreatList();
|
||||
|
||||
// xinef: update speed after charming
|
||||
@@ -18066,14 +18066,14 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
|
||||
// modify hostile references for new phasemask, some special cases deal with hostile references themselves
|
||||
if (GetTypeId() == TYPEID_UNIT || (!ToPlayer()->IsGameMaster() && !ToPlayer()->GetSession()->PlayerLogout()))
|
||||
{
|
||||
HostileRefManager& refManager = getHostileRefManager();
|
||||
HostileReference* ref = refManager.getFirst();
|
||||
HostileRefMgr& refMgr = getHostileRefMgr();
|
||||
HostileReference* ref = refMgr.getFirst();
|
||||
|
||||
while (ref)
|
||||
{
|
||||
if (Unit* unit = ref->GetSource()->GetOwner())
|
||||
if (Creature* creature = unit->ToCreature())
|
||||
refManager.setOnlineOfflineState(creature, creature->InSamePhase(newPhaseMask));
|
||||
refMgr.setOnlineOfflineState(creature, creature->InSamePhase(newPhaseMask));
|
||||
|
||||
ref = ref->next();
|
||||
}
|
||||
@@ -18081,8 +18081,8 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
|
||||
// modify threat lists for new phasemask
|
||||
if (GetTypeId() != TYPEID_PLAYER)
|
||||
{
|
||||
ThreatContainer::StorageType threatList = getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType offlineThreatList = getThreatManager().getOfflineThreatList();
|
||||
ThreatContainer::StorageType threatList = getThreatMgr().getThreatList();
|
||||
ThreatContainer::StorageType offlineThreatList = getThreatMgr().getOfflineThreatList();
|
||||
|
||||
// merge expects sorted lists
|
||||
threatList.sort();
|
||||
@@ -18091,7 +18091,7 @@ void Unit::SetPhaseMask(uint32 newPhaseMask, bool update)
|
||||
|
||||
for (ThreatContainer::StorageType::const_iterator itr = threatList.begin(); itr != threatList.end(); ++itr)
|
||||
if (Unit* unit = (*itr)->getTarget())
|
||||
unit->getHostileRefManager().setOnlineOfflineState(ToCreature(), unit->InSamePhase(newPhaseMask));
|
||||
unit->getHostileRefMgr().setOnlineOfflineState(ToCreature(), unit->InSamePhase(newPhaseMask));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -19021,15 +19021,15 @@ void Unit::UpdateHeight(float newZ)
|
||||
|
||||
void Unit::SendThreatListUpdate()
|
||||
{
|
||||
if (!getThreatManager().isThreatListEmpty())
|
||||
if (!getThreatMgr().isThreatListEmpty())
|
||||
{
|
||||
uint32 count = getThreatManager().getThreatList().size();
|
||||
uint32 count = getThreatMgr().getThreatList().size();
|
||||
|
||||
//LOG_DEBUG("entities.unit", "WORLD: Send SMSG_THREAT_UPDATE Message");
|
||||
WorldPacket data(SMSG_THREAT_UPDATE, 8 + count * 8);
|
||||
data << GetPackGUID();
|
||||
data << uint32(count);
|
||||
ThreatContainer::StorageType const& tlist = getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& tlist = getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
{
|
||||
data << (*itr)->getUnitGuid().WriteAsPacked();
|
||||
@@ -19041,16 +19041,16 @@ void Unit::SendThreatListUpdate()
|
||||
|
||||
void Unit::SendChangeCurrentVictimOpcode(HostileReference* pHostileReference)
|
||||
{
|
||||
if (!getThreatManager().isThreatListEmpty())
|
||||
if (!getThreatMgr().isThreatListEmpty())
|
||||
{
|
||||
uint32 count = getThreatManager().getThreatList().size();
|
||||
uint32 count = getThreatMgr().getThreatList().size();
|
||||
|
||||
LOG_DEBUG("entities.unit", "WORLD: Send SMSG_HIGHEST_THREAT_UPDATE Message");
|
||||
WorldPacket data(SMSG_HIGHEST_THREAT_UPDATE, 8 + 8 + count * 8);
|
||||
data << GetPackGUID();
|
||||
data << pHostileReference->getUnitGuid().WriteAsPacked();
|
||||
data << uint32(count);
|
||||
ThreatContainer::StorageType const& tlist = getThreatManager().getThreatList();
|
||||
ThreatContainer::StorageType const& tlist = getThreatMgr().getThreatList();
|
||||
for (ThreatContainer::StorageType::const_iterator itr = tlist.begin(); itr != tlist.end(); ++itr)
|
||||
{
|
||||
data << (*itr)->getUnitGuid().WriteAsPacked();
|
||||
@@ -19136,7 +19136,7 @@ void Unit::StopAttackFaction(uint32 faction_id)
|
||||
++itr;
|
||||
}
|
||||
|
||||
getHostileRefManager().deleteReferencesForFaction(faction_id);
|
||||
getHostileRefMgr().deleteReferencesForFaction(faction_id);
|
||||
|
||||
for (ControlSet::const_iterator itr = m_Controlled.begin(); itr != m_Controlled.end(); ++itr)
|
||||
(*itr)->StopAttackFaction(faction_id);
|
||||
@@ -19941,7 +19941,7 @@ bool Unit::IsInCombatWith(Unit const* who) const
|
||||
return false;
|
||||
// Search in threat list
|
||||
ObjectGuid guid = who->GetGUID();
|
||||
for (ThreatContainer::StorageType::const_iterator i = m_ThreatManager.getThreatList().begin(); i != m_ThreatManager.getThreatList().end(); ++i)
|
||||
for (ThreatContainer::StorageType::const_iterator i = m_ThreatMgr.getThreatList().begin(); i != m_ThreatMgr.getThreatList().end(); ++i)
|
||||
{
|
||||
HostileReference* ref = (*i);
|
||||
// Return true if the unit matches
|
||||
|
||||
Reference in New Issue
Block a user