Scripts/Pet: Fixed Mirror Image trying attacking invalid targets

(cherry picked from commit 456aaf2cea40160ad8f8b2504a003a1991db741a)
This commit is contained in:
Keader
2022-01-06 19:41:22 +01:00
committed by Shauren
parent 2029d21f73
commit 08d3bc7488
+1 -1
View File
@@ -174,7 +174,7 @@ class npc_pet_mage_mirror_image : public CreatureScript
bool CanAIAttack(Unit const* who) const override
{
Unit* owner = me->GetOwner();
return owner && who->IsAlive() &&
return owner && who->IsAlive() && me->IsValidAttackTarget(who) &&
!who->HasBreakableByDamageCrowdControlAura() &&
who->IsInCombatWith(owner) && ScriptedAI::CanAIAttack(who);
}