mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-10 23:37:31 +07:00
Fixed stat conversion constructions (Science, Gold) not appearing
This commit is contained in:
parent
fd4a0fc781
commit
1749efa50a
@ -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 }
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user