From b3498e6959a43ad1d6927e6bc359a65812cba29b Mon Sep 17 00:00:00 2001 From: Xander Lenstra <71121390+xlenstra@users.noreply.github.com> Date: Sun, 4 Jul 2021 05:23:02 +0200 Subject: [PATCH] Fixed two more of my own bugs (#4361) * Fixed bug were required science for tech did not match label * Fixed a bug --- core/src/com/unciv/logic/city/CityInfo.kt | 3 ++- core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/core/src/com/unciv/logic/city/CityInfo.kt b/core/src/com/unciv/logic/city/CityInfo.kt index 5193497e9e..960285149b 100644 --- a/core/src/com/unciv/logic/city/CityInfo.kt +++ b/core/src/com/unciv/logic/city/CityInfo.kt @@ -101,7 +101,6 @@ class CityInfo { val ruleset = civInfo.gameInfo.ruleSet val startingEra = civInfo.gameInfo.gameParameters.startingEra if (startingEra in ruleset.eras) { - population.setPopulation(ruleset.eras[startingEra]!!.settlerPopulation) for (building in ruleset.eras[startingEra]!!.settlerBuildings) { if (ruleset.buildings[building]!!.isBuildable(cityConstructions)) { cityConstructions.addBuilding(building) @@ -122,6 +121,8 @@ class CityInfo { tile.improvementInProgress = null workedTiles = hashSetOf() //reassign 1st working tile + if (startingEra in ruleset.eras) + population.setPopulation(ruleset.eras[startingEra]!!.settlerPopulation) population.autoAssignPopulation() cityStats.update() diff --git a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt index 5b795e54d8..1a7a3b1ad0 100644 --- a/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt +++ b/core/src/com/unciv/ui/pickerscreens/TechPickerScreen.kt @@ -265,7 +265,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec private fun getTechProgressLabel(techs: List): String { val progress = techs.sumBy { tech -> civTech.scienceSpentOnTech(tech) } - val techCost = techs.sumBy { tech -> civInfo.gameInfo.ruleSet.technologies[tech]!!.cost } + val techCost = techs.sumBy { tech -> civInfo.tech.costOfTech(tech) } return "(${progress}/${techCost})" }