diff options
Diffstat (limited to 'src/server/game/Entities/Unit')
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.cpp | 22 | ||||
| -rw-r--r-- | src/server/game/Entities/Unit/Unit.h | 1 |
2 files changed, 3 insertions, 20 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp index fe94238f9ed..bd512988fb0 100644 --- a/src/server/game/Entities/Unit/Unit.cpp +++ b/src/server/game/Entities/Unit/Unit.cpp @@ -7713,16 +7713,11 @@ void Unit::SetImmuneToAll(bool apply, bool keepCombat) { AddUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)); ValidateAttackersAndOwnTarget(); - if (keepCombat) - m_threatManager.UpdateOnlineStates(true, true); - else + if (!keepCombat) m_combatManager.EndAllCombat(); } else - { RemoveUnitFlag(UnitFlags(UNIT_FLAG_IMMUNE_TO_PC | UNIT_FLAG_IMMUNE_TO_NPC)); - m_threatManager.UpdateOnlineStates(true, true); - } } void Unit::SetImmuneToPC(bool apply, bool keepCombat) @@ -7731,9 +7726,7 @@ void Unit::SetImmuneToPC(bool apply, bool keepCombat) { AddUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); ValidateAttackersAndOwnTarget(); - if (keepCombat) - m_threatManager.UpdateOnlineStates(true, true); - else + if (!keepCombat) { std::list<CombatReference*> toEnd; for (auto const& pair : m_combatManager.GetPvECombatRefs()) @@ -7747,10 +7740,7 @@ void Unit::SetImmuneToPC(bool apply, bool keepCombat) } } else - { RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_PC); - m_threatManager.UpdateOnlineStates(true, true); - } } void Unit::SetImmuneToNPC(bool apply, bool keepCombat) @@ -7759,9 +7749,7 @@ void Unit::SetImmuneToNPC(bool apply, bool keepCombat) { AddUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); ValidateAttackersAndOwnTarget(); - if (keepCombat) - m_threatManager.UpdateOnlineStates(true, true); - else + if (!keepCombat) { std::list<CombatReference*> toEnd; for (auto const& pair : m_combatManager.GetPvECombatRefs()) @@ -7775,10 +7763,7 @@ void Unit::SetImmuneToNPC(bool apply, bool keepCombat) } } else - { RemoveUnitFlag(UNIT_FLAG_IMMUNE_TO_NPC); - m_threatManager.UpdateOnlineStates(true, true); - } } bool Unit::IsThreatened() const @@ -11527,7 +11512,6 @@ void Unit::UpdateObjectVisibility(bool forced) AddToNotify(NOTIFY_VISIBILITY_CHANGED); else { - m_threatManager.UpdateOnlineStates(true, true); WorldObject::UpdateObjectVisibility(true); // call MoveInLineOfSight for nearby creatures Trinity::AIRelocationNotifier notifier(*this); diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h index 3035bc2fa2b..e6bd72cf6e7 100644 --- a/src/server/game/Entities/Unit/Unit.h +++ b/src/server/game/Entities/Unit/Unit.h @@ -1127,7 +1127,6 @@ class TC_GAME_API Unit : public WorldObject ThreatManager const& GetThreatManager() const { return m_threatManager; } void SendClearTarget(); - void SendThreatListUpdate() { m_threatManager.SendThreatListToClients(); } bool HasAuraTypeWithFamilyFlags(AuraType auraType, uint32 familyName, flag128 familyFlags) const; bool virtual HasSpell(uint32 /*spellID*/) const { return false; } |
