Reset nextScanTime only when actually scanning for targets.

This commit is contained in:
Paul Chote
2020-02-16 12:37:35 +00:00
committed by reaperrr
parent 96463634c7
commit 28f7604172

View File

@@ -290,12 +290,12 @@ namespace OpenRA.Mods.Common.Traits
{ {
if (nextScanTime <= 0 && ActiveAttackBases.Any()) if (nextScanTime <= 0 && ActiveAttackBases.Any())
{ {
nextScanTime = self.World.SharedRandom.Next(Info.MinimumScanTimeInterval, Info.MaximumScanTimeInterval);
foreach (var dat in disableAutoTarget) foreach (var dat in disableAutoTarget)
if (dat.DisableAutoTarget(self, allowMove)) if (dat.DisableAutoTarget(self, allowMove))
return Target.Invalid; return Target.Invalid;
nextScanTime = self.World.SharedRandom.Next(Info.MinimumScanTimeInterval, Info.MaximumScanTimeInterval);
foreach (var ab in ActiveAttackBases) foreach (var ab in ActiveAttackBases)
{ {
// If we can't attack right now, there's no need to try and find a target. // If we can't attack right now, there's no need to try and find a target.