refactor(Core/Combat): Code style and improvement of ThreatMgr (#12992)

This commit is contained in:
Maelthyr
2022-09-25 20:20:34 +02:00
committed by GitHub
parent ddcf0e79b6
commit 1f472bddd3
61 changed files with 212 additions and 196 deletions

View File

@@ -320,7 +320,7 @@ public:
{
Talk(SAY_YSONDRE_SUMMON_DRUIDS);
auto const& attackers = me->GetThreatMgr().getThreatList();
auto const& attackers = me->GetThreatMgr().GetThreatList();
uint8 attackersCount = 0;
for (const auto attacker : attackers)

View File

@@ -111,7 +111,7 @@ bool NPCStaveQuestAI::IsFairFight()
{
Unit* unit = ObjectAccessor::GetUnit(*me, (*itr)->getUnitGuid());
if (!(*itr)->getThreat())
if (!(*itr)->GetThreat())
{
// if target threat is 0 its fair, this prevents despawn in the case when
// there is a bystander since UpdateVictim adds nearby enemies to the threatlist

View File

@@ -138,7 +138,7 @@ struct NPCStaveQuestAI : public ScriptedAI
ObjectGuid gossipPlayerGUID;
ObjectGuid playerGUID;
bool encounterStarted;
ThreatContainer::StorageType const& threatList = me->GetThreatMgr().getThreatList();
ThreatContainer::StorageType const& threatList = me->GetThreatMgr().GetThreatList();
std::map<int, int> entryKeys = {
{ ARTORIUS_NORMAL_ENTRY, 1 },