City construction queue: Subsequent units no longer displays construction progress towards first unit of its kind

This commit is contained in:
Yair Morgenstern 2021-06-01 19:56:54 +03:00
parent c45ecebb0c
commit bc1405cdb3
3 changed files with 3 additions and 3 deletions

View File

@ -123,7 +123,7 @@ class CityConstructions {
val construction = getConstruction(constructionName)
val cost = construction.getProductionCost(cityInfo.civInfo)
val turnsToConstruction = turnsToConstruction(constructionName, useStoredProduction)
val currentProgress = getWorkDone(constructionName)
val currentProgress = if (useStoredProduction) getWorkDone(constructionName) else 0
if (currentProgress == 0) return "\n$cost${Fonts.production} $turnsToConstruction${Fonts.turn}"
else return "\n$currentProgress/$cost${Fonts.production}\n$turnsToConstruction${Fonts.turn}"
}

View File

@ -323,7 +323,7 @@ class Ruleset {
fun getPrereqTree(technologyName: String): Sequence<String> {
val technology = technologies[technologyName]
if (technology == null) return sequenceOf()
return technology.prerequisites.asSequence() + technology.prerequisites.flatMap { getPrereqTree(it) }
return technology.prerequisites.asSequence() + technology.prerequisites.asSequence().flatMap { getPrereqTree(it) }
}
val allOtherPrereqs = tech.prerequisites.asSequence().filterNot { it == prereq }.flatMap { getPrereqTree(it) }

View File

@ -220,7 +220,7 @@ class CityConstructionsTable(val cityScreen: CityScreen) : Table(CameraStageBase
var text = constructionName.tr() +
if (constructionName in PerpetualConstruction.perpetualConstructionsMap) "\n"
else cityConstructions.getTurnsToConstructionString(constructionName)
else cityConstructions.getTurnsToConstructionString(constructionName, isFirstConstructionOfItsKind)
val constructionResource = cityConstructions.getConstruction(constructionName).getResourceRequirements()
for ((resource, amount) in constructionResource)