From eb3f8c945cfcbb42a4bce8db1d7c1f3cd99598d9 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Tue, 11 Oct 2016 20:42:15 +0100 Subject: [PATCH] Make sure AI can deploy an MCV when it lacks a base. --- OpenRA.Mods.Common/AI/HackyAI.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index 5bc2c9d482..443a887fb0 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -964,8 +964,12 @@ namespace OpenRA.Mods.Common.AI if (!mcv.IsIdle) continue; + // If we lack a base, we need to make sure we don't restrict deployment of the MCV to the base! + var restrictToBase = + Info.RestrictMCVDeploymentFallbackToBase && + CountBuildingByCommonName(Info.BuildingCommonNames.ConstructionYard, Player) > 0; var factType = mcv.Info.TraitInfo().IntoActor; - var desiredLocation = ChooseBuildLocation(factType, Info.RestrictMCVDeploymentFallbackToBase, BuildingType.Building); + var desiredLocation = ChooseBuildLocation(factType, restrictToBase, BuildingType.Building); if (desiredLocation == null) continue;