Core/AI: Replace many Unit::IsHostileTo with Unit::IsValidAttackTarget or Creature::canCreatureAttack.
This commit is contained in:
@@ -281,7 +281,7 @@ public:
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
|
||||
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsValidAttackTarget(who))
|
||||
AttackStart(who);
|
||||
}
|
||||
|
||||
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsHostileTo(who))
|
||||
if (me->IsWithinDist(who, 50) && !me->isInCombat() && me->IsValidAttackTarget(who))
|
||||
AttackStart(who);
|
||||
}
|
||||
|
||||
|
||||
@@ -1437,7 +1437,7 @@ public:
|
||||
if (!who || me->getVictim())
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && me->IsHostileTo(who))
|
||||
if (me->IsValidAttackTarget(who))
|
||||
{
|
||||
//float attackRadius = me->GetAttackDistance(who);
|
||||
if (me->IsWithinDistInMap(who, 30))
|
||||
|
||||
@@ -294,7 +294,7 @@ struct boss_twinemperorsAI : public ScriptedAI
|
||||
if (!who || me->getVictim())
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(me) && me->IsHostileTo(who))
|
||||
if (me->canCreatureAttack(who))
|
||||
{
|
||||
float attackRadius = me->GetAttackDistance(who);
|
||||
if (attackRadius < PULL_RANGE)
|
||||
|
||||
Reference in New Issue
Block a user