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

@@ -13917,7 +13917,7 @@ void Unit::setDeathState(DeathState s, bool despawn)
if (s != ALIVE && s != JUST_RESPAWNED)
{
CombatStop();
DeleteThreatList();
GetThreatMgr().ClearAllThreat();
getHostileRefMgr().deleteReferences();
ClearComboPointHolders(); // any combo points pointed to unit lost at it death
@@ -14018,15 +14018,6 @@ void Unit::AddThreat(Unit* victim, float fThreat, SpellSchoolMask schoolMask, Sp
//======================================================================
void Unit::DeleteThreatList()
{
if (CanHaveThreatList() && !m_ThreatMgr.isThreatListEmpty())
SendClearThreatListOpcode();
m_ThreatMgr.clearReferences();
}
//======================================================================
void Unit::TauntApply(Unit* taunter)
{
ASSERT(GetTypeId() == TYPEID_UNIT);
@@ -15097,7 +15088,7 @@ void Unit::CleanupBeforeRemoveFromMap(bool finalCleanup)
CombatStop();
ClearComboPoints();
ClearComboPointHolders();
DeleteThreatList();
GetThreatMgr().ClearAllThreat();
getHostileRefMgr().deleteReferences();
GetMotionMaster()->Clear(false); // remove different non-standard movement generators.
}
@@ -17446,7 +17437,7 @@ void Unit::Kill(Unit* killer, Unit* victim, bool durabilityLoss, WeaponAttackTyp
if (!creature->IsPet() && creature->GetLootMode() > 0)
{
creature->DeleteThreatList();
creature->GetThreatMgr().ClearAllThreat();
// must be after setDeathState which resets dynamic flags
if (!creature->loot.isLooted())