From 36e3b64bcd038bacd49628ce5867adef67bc2c0c Mon Sep 17 00:00:00 2001 From: yairm210 Date: Thu, 21 Aug 2025 17:36:39 +0300 Subject: [PATCH] Since improvement buildings with no relevant tiles are unbuildable, we don't need to explicitly check for this in allowAutomatedConstruction See #13831 --- .../com/unciv/logic/automation/Automation.kt | 19 +------------------ 1 file changed, 1 insertion(+), 18 deletions(-) diff --git a/core/src/com/unciv/logic/automation/Automation.kt b/core/src/com/unciv/logic/automation/Automation.kt index 291e34044b..16548778bd 100644 --- a/core/src/com/unciv/logic/automation/Automation.kt +++ b/core/src/com/unciv/logic/automation/Automation.kt @@ -329,26 +329,9 @@ object Automation { city: City, construction: INonPerpetualConstruction ): Boolean { - return allowCreateImprovementBuildings(civInfo, city, construction) - && allowSpendingResource(civInfo, construction, city) + return allowSpendingResource(civInfo, construction, city) } - @Suppress("MemberVisibilityCanBePrivate") - /** Checks both feasibility of Buildings with a [UniqueType.CreatesOneImprovement] unique (appropriate tile available). - * Constructions without pass uncontested. */ - @Readonly - fun allowCreateImprovementBuildings( - civInfo: Civilization, - city: City, - construction: INonPerpetualConstruction - ): Boolean { - if (construction !is Building) return true - if (!construction.hasCreateOneImprovementUnique()) return true // redundant but faster??? - val improvement = construction.getImprovementToCreate(city.getRuleset(), civInfo) ?: return true - return city.getTiles().any { - it.improvementFunctions.canBuildImprovement(improvement, city.state) - } - } /** Determines whether the AI should be willing to spend strategic resources to build * [construction] for [civInfo], assumes that we are actually able to do so. */