From e647af3dd1a5d8bcc5f1c6f205eb3e2bd6994cb3 Mon Sep 17 00:00:00 2001 From: reaperrr Date: Mon, 27 Jun 2016 18:17:51 +0200 Subject: [PATCH] Allow modders to choose AI MCV deployment base restriction For some mods, a random map location might be a better choice for the AI than deploying the MCV inside the base, so we allow modders to customize it. --- OpenRA.Mods.Common/AI/HackyAI.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/AI/HackyAI.cs b/OpenRA.Mods.Common/AI/HackyAI.cs index b1c4b91d84..d6725e21e9 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -125,6 +125,9 @@ namespace OpenRA.Mods.Common.AI [Desc("Radius in cells around the center of the base to expand.")] public readonly int MaxBaseRadius = 20; + [Desc("Should deployment of additional MCVs be restricted to MaxBaseRadius if explicit deploy locations are missing or occupied?")] + public readonly bool RestrictMCVDeploymentFallbackToBase = true; + [Desc("Radius in cells around each building with ProvideBuildableArea", "to check for a 3x3 area of water where naval structures can be built.", "Should match maximum adjacency of naval structures.")] @@ -817,7 +820,7 @@ namespace OpenRA.Mods.Common.AI } // Find any newly constructed MCVs and deploy them at a sensible - // backup location within the main base. + // backup location. void FindAndDeployBackupMcv(Actor self) { var mcvs = self.World.Actors.Where(a => a.Owner == Player && @@ -829,7 +832,7 @@ namespace OpenRA.Mods.Common.AI continue; var factType = mcv.Info.TraitInfo().IntoActor; - var desiredLocation = ChooseBuildLocation(factType, true, BuildingType.Building); + var desiredLocation = ChooseBuildLocation(factType, Info.RestrictMCVDeploymentFallbackToBase, BuildingType.Building); if (desiredLocation == null) continue;