Don't check HasAdequateRefineryCount if no RefineryTypes defined.

This commit is contained in:
Mustafa Alperen Seki
2020-08-03 10:47:43 +03:00
committed by abcdefg30
parent 4cc5104fde
commit 43388cb7fc

View File

@@ -266,7 +266,8 @@ namespace OpenRA.Mods.Common.Traits
get get
{ {
// Require at least one refinery, unless we can't build it. // Require at least one refinery, unless we can't build it.
return AIUtils.CountBuildingByCommonName(Info.RefineryTypes, player) >= MinimumRefineryCount || return !Info.RefineryTypes.Any() ||
AIUtils.CountBuildingByCommonName(Info.RefineryTypes, player) >= MinimumRefineryCount ||
AIUtils.CountBuildingByCommonName(Info.PowerTypes, player) == 0 || AIUtils.CountBuildingByCommonName(Info.PowerTypes, player) == 0 ||
AIUtils.CountBuildingByCommonName(Info.ConstructionYardTypes, player) == 0; AIUtils.CountBuildingByCommonName(Info.ConstructionYardTypes, player) == 0;
} }