Skip to content

Commit

Permalink
Fix new NewProductionCashThreshold check ignore player cash.
Browse files Browse the repository at this point in the history
  • Loading branch information
dnqbob authored and PunkPun committed Sep 7, 2023
1 parent 19c8c36 commit 1b0c93e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ ActorInfo ChooseBuildingToBuild(ProductionQueue queue)
}

// 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))
Expand All @@ -281,7 +281,7 @@ ActorInfo ChooseBuildingToBuild(ProductionQueue queue)

// 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);
Expand Down

0 comments on commit 1b0c93e

Please sign in to comment.