Core/Creature: Fix an oversight in Creature::SelectVictim that was causing creatures to evade when chased by another creature from outside their own aggro range. Closes #19998.

This commit is contained in:
Treeston
2017-08-22 13:08:08 +02:00
parent 6621d8fd7b
commit 1f57d1ac67

View File

@@ -9683,11 +9683,10 @@ Unit* Creature::SelectVictim()
// last case when creature must not go to evade mode:
// it in combat but attacker not make any damage and not enter to aggro radius to have record in threat list
// for example at owner command to pet attack some far away creature
// Note: creature does not have targeted movement generator but has attacker in this case
for (AttackerSet::const_iterator itr = m_attackers.begin(); itr != m_attackers.end(); ++itr)
{
if ((*itr) && !CanCreatureAttack(*itr) && (*itr)->GetTypeId() != TYPEID_PLAYER
if ((*itr) && CanCreatureAttack(*itr) && (*itr)->GetTypeId() != TYPEID_PLAYER
&& !(*itr)->ToCreature()->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN))
return nullptr;
}