Fixed stat conversion constructions (Science, Gold) not appearing

This commit is contained in:
Yair Morgenstern 2022-10-23 19:18:46 +03:00
parent fd4a0fc781
commit 1749efa50a

View File

@ -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 }
}
}