From 1b0c93e5ffdd82301c630fc59f56a5c9c9a0f2ad Mon Sep 17 00:00:00 2001 From: dnqbob Date: Thu, 7 Sep 2023 07:23:47 +0800 Subject: [PATCH] Fix new NewProductionCashThreshold check ignore player cash. --- .../BotModules/BotModuleLogic/BaseBuilderQueueManager.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/BaseBuilderQueueManager.cs b/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/BaseBuilderQueueManager.cs index 83db0b4c41..4a7354b71c 100644 --- a/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/BaseBuilderQueueManager.cs +++ b/OpenRA.Mods.Common/Traits/BotModules/BotModuleLogic/BaseBuilderQueueManager.cs @@ -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(world, player, world.Map, baseBuilder.Info.CheckForWaterRadius, baseBuilder.Info.WaterTerrainTypes)) { var navalproduction = GetProducibleBuilding(baseBuilder.Info.NavalProductionTypes, buildableThings);