From 841c87327649037958b55e9d09ba403c816ae241 Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Tue, 17 Oct 2017 20:51:37 +0300 Subject: [PATCH] Fix Crash when Mcv: UnitsCommonName is empty. --- 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 25d06261be..bb40fc4040 100644 --- a/OpenRA.Mods.Common/AI/HackyAI.cs +++ b/OpenRA.Mods.Common/AI/HackyAI.cs @@ -1186,7 +1186,7 @@ namespace OpenRA.Mods.Common.AI return; // No construction yards - Build a new MCV - if (!HasAdequateFact() && !self.World.Actors.Any(a => a.Owner == Player && + if (Info.UnitsCommonNames.Mcv.Any() && !HasAdequateFact() && !self.World.Actors.Any(a => a.Owner == Player && Info.UnitsCommonNames.Mcv.Contains(a.Info.Name))) BuildUnit("Vehicle", GetInfoByCommonName(Info.UnitsCommonNames.Mcv, Player).Name);