diff options
author | Treeston <treeston.mmoc@gmail.com> | 2018-01-06 01:40:31 +0100 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-05-16 21:56:05 +0200 |
commit | dce39aedc242ecb6e4b1b8dbf8510389dbeecfd2 (patch) | |
tree | 3c8ae5127e5bdf430d6960ed1ad1f15a58f08033 /src/server/game/Combat/ThreatManager.cpp | |
parent | 2a7bb9b4044bbd9f841c5e87a8a910fe4205d4d4 (diff) |
Core/Combat: Some more sanity check asserts to try and track down #21187.
Also, some anti-annoyance treatment for dot tele.
(cherry picked from commit fdacf127395965b426185f05a7b1351138775e89)
Diffstat (limited to 'src/server/game/Combat/ThreatManager.cpp')
-rw-r--r-- | src/server/game/Combat/ThreatManager.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/server/game/Combat/ThreatManager.cpp b/src/server/game/Combat/ThreatManager.cpp index 643020d0c56..2592843a3b4 100644 --- a/src/server/game/Combat/ThreatManager.cpp +++ b/src/server/game/Combat/ThreatManager.cpp @@ -159,6 +159,13 @@ ThreatManager::ThreatManager(Unit* owner) : _owner(owner), _ownerCanHaveThreatLi _singleSchoolModifiers[i] = 1.0f; } +ThreatManager::~ThreatManager() +{ + ASSERT(_myThreatListEntries.empty(), "ThreatManager::~ThreatManager - %s: we still have %zu things threatening us, one of them is %s.", _owner->GetGUID().ToString().c_str(), _myThreatListEntries.size(), _myThreatListEntries.begin()->first.ToString().c_str()); + ASSERT(_sortedThreatList.empty(), "ThreatManager::~ThreatManager - %s: we still have %zu things threatening us, one of them is %s.", _owner->GetGUID().ToString().c_str(), _sortedThreatList.size(), (*_sortedThreatList.begin())->GetVictim()->GetGUID().ToString().c_str()); + ASSERT(_threatenedByMe.empty(), "ThreatManager::~ThreatManager - %s: we are still threatening %zu things, one of them is %s.", _owner->GetGUID().ToString().c_str(), _threatenedByMe.size(), _threatenedByMe.begin()->first.ToString().c_str()); +} + void ThreatManager::Initialize() { _ownerCanHaveThreatList = ThreatManager::CanHaveThreatList(_owner); |