From 28f7604172198311225a21f0416304201a115403 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sun, 16 Feb 2020 12:37:35 +0000 Subject: [PATCH] Reset nextScanTime only when actually scanning for targets. --- OpenRA.Mods.Common/Traits/AutoTarget.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/AutoTarget.cs b/OpenRA.Mods.Common/Traits/AutoTarget.cs index 49079ee4e2..05a611a879 100644 --- a/OpenRA.Mods.Common/Traits/AutoTarget.cs +++ b/OpenRA.Mods.Common/Traits/AutoTarget.cs @@ -290,12 +290,12 @@ namespace OpenRA.Mods.Common.Traits { if (nextScanTime <= 0 && ActiveAttackBases.Any()) { - nextScanTime = self.World.SharedRandom.Next(Info.MinimumScanTimeInterval, Info.MaximumScanTimeInterval); - foreach (var dat in disableAutoTarget) if (dat.DisableAutoTarget(self, allowMove)) return Target.Invalid; + nextScanTime = self.World.SharedRandom.Next(Info.MinimumScanTimeInterval, Info.MaximumScanTimeInterval); + foreach (var ab in ActiveAttackBases) { // If we can't attack right now, there's no need to try and find a target.