diff --git a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt index a8514d766e..fa6b93f0e3 100644 --- a/core/src/com/unciv/logic/automation/NextTurnAutomation.kt +++ b/core/src/com/unciv/logic/automation/NextTurnAutomation.kt @@ -141,13 +141,13 @@ object NextTurnAutomation { } private fun getFreeTechForCityStates(civInfo: CivilizationInfo) { - //City-States automatically get all invented techs - for (otherCiv in civInfo.getKnownCivs().filter { it.isMajorCiv() }) { - for (entry in otherCiv.tech.techsResearched - .filterNot { civInfo.tech.isResearched(it) } - .filter { civInfo.tech.canBeResearched(it) }) { - civInfo.tech.addTechnology(entry) - } + // City-States automatically get all techs that at least half of the major civs know + val researchableTechs = civInfo.gameInfo.ruleSet.technologies.keys + .filter { civInfo.tech.canBeResearched(it) } + for (tech in researchableTechs) { + val aliveMajorCivs = civInfo.gameInfo.getAliveMajorCivs() + if (aliveMajorCivs.count { it.tech.isResearched(tech) } >= aliveMajorCivs.count() / 2) + civInfo.tech.addTechnology(tech) } return } diff --git a/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt b/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt index c36d7998fd..08b8d26273 100644 --- a/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt +++ b/core/src/com/unciv/ui/cityscreen/CityConstructionsTable.kt @@ -18,7 +18,6 @@ import com.unciv.models.stats.Stat import com.unciv.models.translations.tr import com.unciv.ui.utils.* import kotlin.concurrent.thread -import kotlin.math.min import com.unciv.ui.utils.AutoScrollPane as ScrollPane class CityConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBaseScreen.skin) {