Merge pull request #12214 from RoosterDragon/mcv-build

Make sure AI can deploy an MCV when it lacks a base.
This commit is contained in:
reaperrr
2016-10-14 18:23:27 +02:00
committed by GitHub

View File

@@ -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<TransformsInfo>().IntoActor;
var desiredLocation = ChooseBuildLocation(factType, Info.RestrictMCVDeploymentFallbackToBase, BuildingType.Building);
var desiredLocation = ChooseBuildLocation(factType, restrictToBase, BuildingType.Building);
if (desiredLocation == null)
continue;