Core/AI: Replace many Unit::IsHostileTo with Unit::IsValidAttackTarget or Creature::canCreatureAttack.
This commit is contained in:
@@ -179,7 +179,7 @@ public:
|
||||
if (!SpawnAssoc)
|
||||
return;
|
||||
|
||||
if (who->isTargetableForAttack() && me->IsHostileTo(who))
|
||||
if (me->IsValidAttackTarget(who))
|
||||
{
|
||||
Player* playerTarget = who->ToPlayer();
|
||||
|
||||
@@ -1718,7 +1718,7 @@ public:
|
||||
//Redefined for random target selection:
|
||||
void MoveInLineOfSight(Unit* who)
|
||||
{
|
||||
if (!me->getVictim() && who->isTargetableForAttack() && (me->IsHostileTo(who)) && who->isInAccessiblePlaceFor(me))
|
||||
if (!me->getVictim() && me->canCreatureAttack(who))
|
||||
{
|
||||
if (me->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE)
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user