From 03590b13cc065c864f7453b63279432e30ed3ab7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 24 Jan 2016 13:52:44 +0100 Subject: [PATCH] check the cheap bool before expensive trait lookups --- OpenRA.Mods.Common/AI/HackyAI.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index fa21d57570..cdc1f12d62 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -765,7 +765,7 @@ namespace OpenRA.Mods.Common.AI { var allEnemyBaseBuilder = FindEnemyConstructionYards(); var ownUnits = activeUnits - .Where(unit => unit.Info.HasTraitInfo() && !unit.Info.HasTraitInfo() && unit.IsIdle).ToList(); + .Where(unit => unit.IsIdle && unit.Info.HasTraitInfo() && !unit.Info.HasTraitInfo()).ToList(); if (!allEnemyBaseBuilder.Any() || (ownUnits.Count < Info.SquadSize)) return;