[9159] Skip invisible/stealthed and not detected targets from threat list at next target selection.

This will fix work spell 58984 and similar in combat.
This commit is contained in:
VladimirMangos 2010-01-12 10:45:34 +03:00
parent 2c092b1c34
commit 83261d9b9b
2 changed files with 8 additions and 5 deletions

View file

@ -1607,16 +1607,19 @@ void Creature::SaveRespawnTime()
bool Creature::IsOutOfThreatArea(Unit* pVictim) const bool Creature::IsOutOfThreatArea(Unit* pVictim) const
{ {
if(!pVictim) if (!pVictim)
return true; return true;
if(!pVictim->IsInMap(this)) if (!pVictim->IsInMap(this))
return true; return true;
if(!pVictim->isTargetableForAttack()) if (!pVictim->isTargetableForAttack())
return true; return true;
if(!pVictim->isInAccessablePlaceFor(this)) if (!pVictim->isInAccessablePlaceFor(this))
return true;
if (!pVictim->isVisibleForOrDetect(this,this,false))
return true; return true;
if(sMapStore.LookupEntry(GetMapId())->IsDungeon()) if(sMapStore.LookupEntry(GetMapId())->IsDungeon())

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9158" #define REVISION_NR "9159"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__