Fix new NewProductionCashThreshold check ignore player cash.

This commit is contained in:
dnqbob
2023-09-07 07:23:47 +08:00
committed by Gustas
parent 19c8c36030
commit 1b0c93e5ff

View File

@@ -263,7 +263,7 @@ namespace OpenRA.Mods.Common.Traits
}
// Make sure that we can spend as fast as we are earning
if (baseBuilder.Info.NewProductionCashThreshold > 0 && playerResources.Resources > baseBuilder.Info.NewProductionCashThreshold)
if (baseBuilder.Info.NewProductionCashThreshold > 0 && playerResources.GetCashAndResources() > baseBuilder.Info.NewProductionCashThreshold)
{
var production = GetProducibleBuilding(baseBuilder.Info.ProductionTypes, buildableThings);
if (production != null && HasSufficientPowerForActor(production))
@@ -281,7 +281,7 @@ namespace OpenRA.Mods.Common.Traits
// Only consider building this if there is enough water inside the base perimeter and there are close enough adjacent buildings
if (waterState == WaterCheck.EnoughWater && baseBuilder.Info.NewProductionCashThreshold > 0
&& playerResources.Resources > baseBuilder.Info.NewProductionCashThreshold
&& playerResources.GetCashAndResources() > baseBuilder.Info.NewProductionCashThreshold
&& AIUtils.IsAreaAvailable<GivesBuildableArea>(world, player, world.Map, baseBuilder.Info.CheckForWaterRadius, baseBuilder.Info.WaterTerrainTypes))
{
var navalproduction = GetProducibleBuilding(baseBuilder.Info.NavalProductionTypes, buildableThings);