refactor(Core/Combat): DeleteThreatLists() become ClearAllThreat() (#11824)

refactor(Chore/Combat): DeleteThreatLists() become ClearAllThreat()
This commit is contained in:
Maelthyr
2022-05-23 10:51:52 +02:00
committed by GitHub
parent ae3ecb0f1a
commit dfc6adb081
40 changed files with 62 additions and 63 deletions

View File

@@ -203,7 +203,7 @@ public:
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->LoadCreaturesAddon(true);
if (me->IsAlive())

View File

@@ -779,7 +779,7 @@ public:
//do not call EnterEvadeMode(), it will create infinit loops
boss->Respawn();
boss->RemoveAllAuras();
boss->DeleteThreatList();
boss->GetThreatMgr().ClearAllThreat();
boss->CombatStop(true);
boss->LoadCreaturesAddon(true);
boss->GetMotionMaster()->MoveTargetedHome();

View File

@@ -1243,7 +1243,7 @@ public:
Julianne->GetMotionMaster()->Clear();
Julianne->setDeathState(JUST_DIED);
Julianne->CombatStop(true);
Julianne->DeleteThreatList();
Julianne->GetThreatMgr().ClearAllThreat();
Julianne->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
}
return;
@@ -1546,7 +1546,7 @@ void boss_julianne::boss_julianneAI::DamageTaken(Unit* /*done_by*/, uint32& dama
Romulo->GetMotionMaster()->Clear();
Romulo->setDeathState(JUST_DIED);
Romulo->CombatStop(true);
Romulo->DeleteThreatList();
Romulo->GetThreatMgr().ClearAllThreat();
Romulo->ReplaceAllDynamicFlags(UNIT_DYNFLAG_LOOTABLE);
}

View File

@@ -242,7 +242,7 @@ public:
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(false);
me->SetLootRecipient(nullptr);

View File

@@ -697,13 +697,13 @@ public:
if (Creature* summon = ObjectAccessor::GetCreature(*me, *itr))
{
summon->CombatStop(true);
summon->DeleteThreatList();
summon->GetThreatMgr().ClearAllThreat();
summon->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
summon->SetReactState(REACT_PASSIVE);
summon->GetMotionMaster()->Clear(false);
}
me->CombatStop(true);
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->SetUnitFlag(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC);
me->SetReactState(REACT_PASSIVE);
me->GetMotionMaster()->Clear(false);

View File

@@ -329,7 +329,7 @@ public:
me->SetTarget();
me->SetReactState(REACT_PASSIVE);
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->SetRegeneratingHealth(false);
me->SetUnitFlag(UNIT_FLAG_NON_ATTACKABLE);
me->HandleEmoteCommand(EMOTE_ONESHOT_DROWN);

View File

@@ -71,8 +71,8 @@ public:
if (player->GetQuestStatus(592) == QUEST_STATUS_INCOMPLETE) //Yenniku's Release
{
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN);
me->CombatStop(); //stop combat
me->DeleteThreatList(); //unsure of this
me->CombatStop(); //stop combat
me->GetThreatMgr().ClearAllThreat(); //unsure of this
me->SetFaction(FACTION_HORDE_GENERIC);
bReset = true;
@@ -104,7 +104,7 @@ public:
if (player->GetTeamId() == TEAM_HORDE)
{
me->CombatStop();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
}
}
}

View File

@@ -1013,7 +1013,7 @@ public:
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->SetLootRecipient(nullptr);
@@ -2356,7 +2356,7 @@ public:
void EnterEvadeMode(EvadeReason /*why*/) override
{
me->RemoveAura(SPELL_HEROIC_VANGUARD);
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
me->SetLootRecipient(nullptr);

View File

@@ -118,7 +118,7 @@ public:
me->RestoreFaction();
me->RemoveAllAuras();
me->DeleteThreatList();
me->GetThreatMgr().ClearAllThreat();
me->CombatStop(true);
SetRun(false);