diff options
author | Machiavelli <none@none> | 2009-08-21 16:07:12 +0200 |
---|---|---|
committer | Machiavelli <none@none> | 2009-08-21 16:07:12 +0200 |
commit | cc4ae11383d360148ae582dc14fba0a3d04092dd (patch) | |
tree | f38518a46bd15ee242e86bac5efe74d08664e215 /src/game/ThreatManager.cpp | |
parent | 383e22448dcddf92b93698a89290ea3f7d43d43a (diff) |
* Fix some crashes in ThreatContainer
--HG--
branch : trunk
Diffstat (limited to 'src/game/ThreatManager.cpp')
-rw-r--r-- | src/game/ThreatManager.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/ThreatManager.cpp b/src/game/ThreatManager.cpp index 5db2a99440d..4c2727c1567 100644 --- a/src/game/ThreatManager.cpp +++ b/src/game/ThreatManager.cpp @@ -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) |