mirror of
https://github.com/yairm210/Unciv.git
synced 2025-03-10 04:43:29 +07:00
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:
parent
aa132c8bf8
commit
b3498e6959
@ -101,7 +101,6 @@ class CityInfo {
|
|||||||
val ruleset = civInfo.gameInfo.ruleSet
|
val ruleset = civInfo.gameInfo.ruleSet
|
||||||
val startingEra = civInfo.gameInfo.gameParameters.startingEra
|
val startingEra = civInfo.gameInfo.gameParameters.startingEra
|
||||||
if (startingEra in ruleset.eras) {
|
if (startingEra in ruleset.eras) {
|
||||||
population.setPopulation(ruleset.eras[startingEra]!!.settlerPopulation)
|
|
||||||
for (building in ruleset.eras[startingEra]!!.settlerBuildings) {
|
for (building in ruleset.eras[startingEra]!!.settlerBuildings) {
|
||||||
if (ruleset.buildings[building]!!.isBuildable(cityConstructions)) {
|
if (ruleset.buildings[building]!!.isBuildable(cityConstructions)) {
|
||||||
cityConstructions.addBuilding(building)
|
cityConstructions.addBuilding(building)
|
||||||
@ -122,6 +121,8 @@ class CityInfo {
|
|||||||
tile.improvementInProgress = null
|
tile.improvementInProgress = null
|
||||||
|
|
||||||
workedTiles = hashSetOf() //reassign 1st working tile
|
workedTiles = hashSetOf() //reassign 1st working tile
|
||||||
|
if (startingEra in ruleset.eras)
|
||||||
|
population.setPopulation(ruleset.eras[startingEra]!!.settlerPopulation)
|
||||||
population.autoAssignPopulation()
|
population.autoAssignPopulation()
|
||||||
cityStats.update()
|
cityStats.update()
|
||||||
|
|
||||||
|
@ -265,7 +265,7 @@ class TechPickerScreen(internal val civInfo: CivilizationInfo, centerOnTech: Tec
|
|||||||
|
|
||||||
private fun getTechProgressLabel(techs: List<String>): String {
|
private fun getTechProgressLabel(techs: List<String>): String {
|
||||||
val progress = techs.sumBy { tech -> civTech.scienceSpentOnTech(tech) }
|
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})"
|
return "(${progress}/${techCost})"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user