Fix: Modded strategic resource without tech prerequisite crashes game (#2460)

This commit is contained in:
SomeTroglodyte 2020-04-18 20:19:52 +02:00 committed by GitHub
parent 885f280747
commit 4f00639969
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -134,7 +134,7 @@ class WorldScreenTopBar(val worldScreen: WorldScreen) : Table() {
.filter { it.resourceType == ResourceType.Strategic }
val civResources = civInfo.getCivResources()
for (resource in revealedStrategicResources) {
val isRevealed = civInfo.tech.isResearched(resource.revealedBy!!)
val isRevealed = resource.revealedBy == null || civInfo.tech.isResearched(resource.revealedBy!!)
resourceLabels[resource.name]!!.isVisible = isRevealed
resourceImages[resource.name]!!.isVisible = isRevealed
if (!civResources.any { it.resource==resource}) resourceLabels[resource.name]!!.setText("0")