diff --git a/core/src/com/unciv/logic/map/TileMap.kt b/core/src/com/unciv/logic/map/TileMap.kt index b8884a1765..14b4a8561a 100644 --- a/core/src/com/unciv/logic/map/TileMap.kt +++ b/core/src/com/unciv/logic/map/TileMap.kt @@ -48,7 +48,7 @@ class TileMap { @Transient lateinit var gameInfo: GameInfo - /** Keep a copy of the [Ruleset] object passer to setTransients, for now only to allow subsequent setTransients without. Copied on [clone]. */ + /** Keep a copy of the [Ruleset] object passed to setTransients, for now only to allow subsequent setTransients without. Copied on [clone]. */ @Transient var ruleset: Ruleset? = null @@ -330,6 +330,8 @@ class TileMap { * Is run before setTransients, so make do without startingLocationsByNation */ fun getRulesetIncompatibility(ruleset: Ruleset): HashSet { + setTransients(ruleset) + setStartingLocationsTransients() val rulesetIncompatibilities = HashSet() for (set in values.map { it.getRulesetIncompatibility(ruleset) }) rulesetIncompatibilities.addAll(set) diff --git a/core/src/com/unciv/ui/tilegroups/TileGroupIcons.kt b/core/src/com/unciv/ui/tilegroups/TileGroupIcons.kt index 00b5faf08b..f2aa0b90bc 100644 --- a/core/src/com/unciv/ui/tilegroups/TileGroupIcons.kt +++ b/core/src/com/unciv/ui/tilegroups/TileGroupIcons.kt @@ -176,14 +176,15 @@ class TileGroupIcons(val tileGroup: TileGroup) { startingLocationIcons.clear() if (!showResourcesAndImprovements) return if (tileGroup.forMapEditorIcon) return // the editor options for terrain do not bother to fully initialize, so tileInfo.tileMap would be an uninitialized lateinit + val tileInfo = tileGroup.tileInfo + if (tileInfo.tileMap.startingLocationsByNation.isEmpty()) return // Allow display of up to three nations starting locations on the same tile, rest only as count. // Sorted so major get precedence and to make the display deterministic, otherwise you could get // different stacking order of the same nations in the same editing session - val tileInfo = tileGroup.tileInfo val nations = tileInfo.tileMap.startingLocationsByNation.asSequence() .filter { tileInfo in it.value } - .map { it.key to ImageGetter.ruleset.nations[it.key]!! } + .map { it.key to tileInfo.tileMap.ruleset!!.nations[it.key]!! } .sortedWith(compareBy({ it.second.isCityState() }, { it.first })) .toList() if (nations.isEmpty()) return