Fix Crash when Mcv: UnitsCommonName is empty.

This commit is contained in:
Mustafa Alperen Seki
2017-10-17 20:51:37 +03:00
committed by Paul Chote
parent 15354f52c1
commit 841c873276

View File

@@ -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);