From 60fe8fc36bf74dd42fbdeb84159c60a9f479052e Mon Sep 17 00:00:00 2001 From: Yair Morgenstern Date: Sat, 6 Feb 2021 19:42:14 +0200 Subject: [PATCH] Game can handle mods removing tile features between versions --- core/src/com/unciv/logic/GameInfo.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index bc6fb1e76f..0932f0326f 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -331,6 +331,8 @@ class GameInfo { // So we remove them so the game doesn't crash when it tries to access them. private fun removeMissingModReferences() { for (tile in tileMap.values) { + if (tile.terrainFeature!=null && !ruleSet.terrains.containsKey(tile.terrainFeature!!)) + tile.terrainFeature = null if (tile.resource != null && !ruleSet.tileResources.containsKey(tile.resource!!)) tile.resource = null if (tile.improvement != null && !ruleSet.tileImprovements.containsKey(tile.improvement!!)