From 4d553900cf2a14dca7d431e9f1d7577f25febb77 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Sat, 2 Dec 2017 08:37:42 +0100 Subject: [PATCH] Move up harv.IsEmpty check in HackyAI This is a fairly cheap check, so we should perform it before the activity checks --- OpenRA.Mods.Common/AI/HackyAI.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index 437b70cccd..2e9ff259d0 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -820,6 +820,9 @@ namespace OpenRA.Mods.Common.AI if (harv == null) continue; + if (!harv.IsEmpty) + continue; + if (!harvester.IsIdle) { var act = harvester.CurrentActivity; @@ -827,9 +830,6 @@ namespace OpenRA.Mods.Common.AI continue; } - if (!harv.IsEmpty) - continue; - // Tell the idle harvester to quit slacking: var newSafeResourcePatch = FindNextResource(harvester, harv); BotDebug("AI: Harvester {0} is idle. Ordering to {1} in search for new resources.".F(harvester, newSafeResourcePatch));