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 fdacf12739)
This commit is contained in:
Treeston
2018-01-06 01:40:31 +01:00
committed by Shauren
parent 2a7bb9b404
commit dce39aedc2
6 changed files with 16 additions and 3 deletions

View File

@@ -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);