Skip to content

Commit

Permalink
[9159] Skip invisible/stealthed and not detected targets from threat …
Browse files Browse the repository at this point in the history
…list at next target selection.

This will fix work spell 58984 and similar in combat.
  • Loading branch information
VladimirMangos committed Jan 12, 2010
1 parent 06e99ea commit d58b53d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions src/game/Creature.cpp
Expand Up @@ -1607,16 +1607,19 @@ void Creature::SaveRespawnTime()

bool Creature::IsOutOfThreatArea(Unit* pVictim) const
{
if(!pVictim)
if (!pVictim)
return true;

if (!pVictim->IsInMap(this))
return true;

if(!pVictim->IsInMap(this))
if (!pVictim->isTargetableForAttack())
return true;

if(!pVictim->isTargetableForAttack())
if (!pVictim->isInAccessablePlaceFor(this))
return true;

if(!pVictim->isInAccessablePlaceFor(this))
if (!pVictim->isVisibleForOrDetect(this,this,false))
return true;

if(sMapStore.LookupEntry(GetMapId())->IsDungeon())
Expand Down
2 changes: 1 addition & 1 deletion src/shared/revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "9158"
#define REVISION_NR "9159"
#endif // __REVISION_NR_H__

0 comments on commit d58b53d

Please sign in to comment.