Core/AI: Replace many Unit::IsHostileTo with Unit::IsValidAttackTarget or Creature::canCreatureAttack.

This commit is contained in:
QAston
2011-09-17 00:56:59 +02:00
parent 580264b5a5
commit fe25ce4fa3
27 changed files with 30 additions and 49 deletions
@@ -85,7 +85,7 @@ class boss_watchkeeper_gargolmar : public CreatureScript
void MoveInLineOfSight(Unit* who)
{
if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
if (!me->getVictim() && me->canCreatureAttack(who))
{
if (!me->canFly() && me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
return;