From cc4ef736b01e90b1c89498542a96629c63d49203 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Fri, 12 Aug 2016 18:08:58 +0100 Subject: [PATCH] Ensure HackyAI tries to attack and capture as frequently as it should. Returning early in AssignRolesToIdleUnits would skip ticking down the counters that trigger new attack and capture attempts. This means they would be attempted far less often than intended. --- OpenRA.Mods.Common/AI/HackyAI.cs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index 4be5e07b41..5f24b6a348 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -659,21 +659,20 @@ namespace OpenRA.Mods.Common.AI s.Update(); } - if (--assignRolesTicks > 0) - return; + if (--assignRolesTicks <= 0) + { + assignRolesTicks = Info.AssignRolesInterval; + GiveOrdersToIdleHarvesters(); + FindNewUnits(self); + FindAndDeployBackupMcv(self); + } - assignRolesTicks = Info.AssignRolesInterval; - - GiveOrdersToIdleHarvesters(); - FindNewUnits(self); if (--minAttackForceDelayTicks <= 0) { minAttackForceDelayTicks = Info.MinimumAttackForceDelay; CreateAttackForce(); } - FindAndDeployBackupMcv(self); - if (--minCaptureDelayTicks <= 0) { minCaptureDelayTicks = Info.MinimumCaptureDelay;