* 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* ThreatContainer::getReferenceByTarget(Unit* pVictim)
|
||||||
{
|
{
|
||||||
HostilReference* result = NULL;
|
HostilReference* result = NULL;
|
||||||
|
if(!pVictim)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
uint64 guid = pVictim->GetGUID();
|
uint64 guid = pVictim->GetGUID();
|
||||||
for(std::list<HostilReference*>::const_iterator i = iThreatList.begin(); i != iThreatList.end(); ++i)
|
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)
|
float ThreatManager::getThreat(Unit *pVictim, bool pAlsoSearchOfflineList)
|
||||||
{
|
{
|
||||||
|
if(!pVictim)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
float threat = 0.0f;
|
float threat = 0.0f;
|
||||||
HostilReference* ref = iThreatContainer.getReferenceByTarget(pVictim);
|
HostilReference* ref = iThreatContainer.getReferenceByTarget(pVictim);
|
||||||
if(!ref && pAlsoSearchOfflineList)
|
if(!ref && pAlsoSearchOfflineList)
|
||||||
|
|||||||
Reference in New Issue
Block a user