Move up harv.IsEmpty check in HackyAI

This is a fairly cheap check, so we should perform it before the activity checks
This commit is contained in:
reaperrr
2017-12-02 08:37:42 +01:00
committed by abcdefg30
parent 70ffa99203
commit 4d553900cf

View File

@@ -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));