From 1749efa50ad3abcb0fd36edf0789fdefe960f61e Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sun, 23 Oct 2022 19:18:46 +0300 Subject: [PATCH] Fixed stat conversion constructions (Science, Gold) not appearing --- core/src/com/unciv/logic/city/IConstruction.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/core/src/com/unciv/logic/city/IConstruction.kt b/core/src/com/unciv/logic/city/IConstruction.kt index 9ae104f95f..b61ee60f63 100644 --- a/core/src/com/unciv/logic/city/IConstruction.kt +++ b/core/src/com/unciv/logic/city/IConstruction.kt @@ -246,11 +246,10 @@ open class PerpetualStatConversion(val stat: Stat) : fun getConversionRate(cityInfo: CityInfo) : Int = (1/cityInfo.cityStats.getStatConversionRate(stat)).roundToInt() override fun isBuildable(cityConstructions: CityConstructions): Boolean { - val hasProductionUnique = cityConstructions.cityInfo.civInfo.getMatchingUniques(UniqueType.EnablesCivWideStatProduction).any { it.params[0] == stat.name } - return when (stat) { - Stat.Culture -> hasProductionUnique - Stat.Faith -> cityConstructions.cityInfo.civInfo.gameInfo.isReligionEnabled() && hasProductionUnique - else -> false - } + if (stat == Stat.Faith && !cityConstructions.cityInfo.civInfo.gameInfo.isReligionEnabled()) + return false + + return cityConstructions.cityInfo.civInfo.getMatchingUniques(UniqueType.EnablesCivWideStatProduction) + .any { it.params[0] == stat.name } } }