Fixed two more of my own bugs (#4361)

* Fixed bug were required science for tech did not match label

* Fixed a bug
This commit is contained in:
Xander Lenstra 2021-07-04 05:23:02 +02:00 committed by GitHub
parent aa132c8bf8
commit b3498e6959
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -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()

View File

@ -265,7 +265,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec
private fun getTechProgressLabel(techs: List<String>): 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})"
}