From 52427168871f4efba505c767983b4c062dfaf836 Mon Sep 17 00:00:00 2001 From: notsinned Date: Sat, 24 Sep 2022 16:42:18 -0400 Subject: [PATCH] Fix for turret following invisible unit Fixed turret tracking invisible units after being attacked Fix for turret following invisible unit Fix for turrent following invisible unit --- OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs b/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs index 27b55cf3b2..cb9edb43fc 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs @@ -123,7 +123,7 @@ namespace OpenRA.Mods.Common.Traits if (mobile != null && !mobile.CanInteractWithGroundLayer(self)) return; - if (RequestedTarget.Type != TargetType.Invalid) + if (RequestedTarget.IsValidFor(self)) { IsAiming = CanAimAtTarget(self, RequestedTarget, requestedForceAttack); if (IsAiming) @@ -133,7 +133,7 @@ namespace OpenRA.Mods.Common.Traits { IsAiming = false; - if (OpportunityTarget.Type != TargetType.Invalid) + if (OpportunityTarget.IsValidFor(self)) IsAiming = CanAimAtTarget(self, OpportunityTarget, opportunityForceAttack); if (!IsAiming && Info.OpportunityFire && autoTarget != null && @@ -143,7 +143,7 @@ namespace OpenRA.Mods.Common.Traits opportunityForceAttack = false; opportunityTargetIsPersistentTarget = false; - if (OpportunityTarget.Type != TargetType.Invalid) + if (OpportunityTarget.IsValidFor(self)) IsAiming = CanAimAtTarget(self, OpportunityTarget, opportunityForceAttack); }