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.

Port From (https://github.com/TrinityCore/TrinityCore/commit/f97b601d9381196a4cfa352bff2d0826f211eda1)
This commit is contained in:
hondacrx
2020-08-24 19:20:38 -04:00
parent 8b6c86d568
commit 15f0aebb23
+1 -2
View File
@@ -3315,11 +3315,10 @@ namespace Game.Entities
// 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
foreach (var unit in attackerList)
{
if (!CanCreatureAttack(unit) && !unit.IsTypeId(TypeId.Player)
if (CanCreatureAttack(unit) && !unit.IsTypeId(TypeId.Player)
&& !unit.ToCreature().HasUnitTypeMask(UnitTypeMask.ControlableGuardian))
return null;
}