Skip to content

Commit

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

This will fix work spell 58984 and similar in combat.

(based on commit d58b53d)
  • Loading branch information
VladimirMangos committed Jan 12, 2010
1 parent 6d41878 commit d17c1ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/game/Creature.cpp
Expand Up @@ -1585,16 +1585,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

0 comments on commit d17c1ab

Please sign in to comment.