* Fix some crashes in ThreatContainer
--HG-- branch : trunk
This commit is contained in:
@@ -214,6 +214,9 @@ void ThreatContainer::clearReferences()
|
||||
HostilReference* ThreatContainer::getReferenceByTarget(Unit* pVictim)
|
||||
{
|
||||
HostilReference* result = NULL;
|
||||
if(!pVictim)
|
||||
return NULL;
|
||||
|
||||
uint64 guid = pVictim->GetGUID();
|
||||
for(std::list<HostilReference*>::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
||||
{
|
||||
@@ -434,6 +437,9 @@ Unit* ThreatManager::getHostilTarget()
|
||||
|
||||
float ThreatManager::getThreat(Unit *pVictim, bool pAlsoSearchOfflineList)
|
||||
{
|
||||
if(!pVictim)
|
||||
return NULL;
|
||||
|
||||
float threat = 0.0f;
|
||||
HostilReference* ref = iThreatContainer.getReferenceByTarget(pVictim);
|
||||
if(!ref && pAlsoSearchOfflineList)
|
||||
|
||||
Reference in New Issue
Block a user