Fix era of Wonders without tech in Wonder overview (#5347)

This commit is contained in:
SomeTroglodyte 2021-09-29 05:19:28 +02:00 committed by GitHub
parent d3868dae62
commit 070c41592f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,7 +115,7 @@ class WonderOverviewTable(
val wonderEraMap: Map<String, Era> =
ruleSet.buildings.values.asSequence()
.filter { it.isWonder }
.map { it.name to ruleSet.eras[ruleSet.technologies[it.requiredTech]?.era()]!! }
.map { it.name to (ruleSet.eras[ruleSet.technologies[it.requiredTech]?.era()] ?: viewingPlayer.getEra()) }
.toMap()
// Maps all World Wonders by their position in sort order to their name