mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 01:37:37 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user