* Fix some crashes in ThreatContainer

--HG--
branch : trunk
This commit is contained in:
Machiavelli
2009-08-21 16:07:12 +02:00
parent 383e22448d
commit cc4ae11383
+6
View File
@@ -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)