mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
refactor(Core/Combat): DeleteThreatLists() become ClearAllThreat() (#11824)
refactor(Chore/Combat): DeleteThreatLists() become ClearAllThreat()
This commit is contained in:
@@ -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())
|
||||
|
||||
Reference in New Issue
Block a user