From 83261d9b9be1c9be9c603f6cd6e81b858b1043fe Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Tue, 12 Jan 2010 10:45:34 +0300 Subject: [PATCH] [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. --- src/game/Creature.cpp | 11 +++++++---- src/shared/revision_nr.h | 2 +- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 616b8db38..f105cb938 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -1607,16 +1607,19 @@ void Creature::SaveRespawnTime() bool Creature::IsOutOfThreatArea(Unit* pVictim) const { - if(!pVictim) + if (!pVictim) return true; - if(!pVictim->IsInMap(this)) + if (!pVictim->IsInMap(this)) return true; - if(!pVictim->isTargetableForAttack()) + if (!pVictim->isTargetableForAttack()) return true; - if(!pVictim->isInAccessablePlaceFor(this)) + if (!pVictim->isInAccessablePlaceFor(this)) + return true; + + if (!pVictim->isVisibleForOrDetect(this,this,false)) return true; if(sMapStore.LookupEntry(GetMapId())->IsDungeon()) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index 66b3d0b4b..ed2a6640f 100644 --- a/src/shared/revision_nr.h +++ b/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__