diff --git a/core/src/com/unciv/models/ruleset/Ruleset.kt b/core/src/com/unciv/models/ruleset/Ruleset.kt index a71d57a0ad..a8c7f586aa 100644 --- a/core/src/com/unciv/models/ruleset/Ruleset.kt +++ b/core/src/com/unciv/models/ruleset/Ruleset.kt @@ -258,12 +258,24 @@ class Ruleset { lines += "${resource.name} revealed by tech ${resource.revealedBy} which does not exist!" if (resource.improvement != null && !tileImprovements.containsKey(resource.improvement!!)) lines += "${resource.name} improved by improvement ${resource.improvement} which does not exist!" + for(terrain in resource.terrainsCanBeFoundOn) + if(!terrains.containsKey(terrain)) + lines += "${resource.name} can be found on terrain $terrain which does not exist!" } for (improvement in tileImprovements.values) { if (improvement.techRequired != null && !technologies.containsKey(improvement.techRequired!!)) lines += "${improvement.name} requires tech ${improvement.techRequired} which does not exist!" + for (terrain in improvement.terrainsCanBeBuiltOn) + if (!terrains.containsKey(terrain)) + lines += "${improvement.name} can be built on terrain $terrain which does not exist!" } +// +// for(terrain in terrains.values){ +// for(baseTerrain in terrain.occursOn) +// if (!terrains.containsKey(baseTerrain)) +// lines += "${improvement.name} can be built on terrain $terrain which does not exist!" +// } for (tech in technologies.values) { for (prereq in tech.prerequisites) { diff --git a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt index 638f79c8f7..df4bc8d027 100644 --- a/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt +++ b/core/src/com/unciv/ui/mapeditor/TileEditorOptionsTable.kt @@ -342,7 +342,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera val resources = ArrayList() resources.add(getHex(Color.WHITE, getCrossedResource()).apply { onClick { - tileAction = {it.resource=null} + tileAction = { it.resource = null } setCurrentHex(getHex(Color.WHITE, getCrossedResource()), "Clear resource") } }) @@ -350,12 +350,12 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera for (resource in ruleset.tileResources.values) { val resourceHex = getHex(Color.WHITE, ImageGetter.getResourceImage(resource.name, 40f)) resourceHex.onClick { - tileAction = {it.resource = resource.name} + tileAction = { it.resource = resource.name } // for the tile image val tileInfo = TileInfo() tileInfo.ruleset = mapEditorScreen.ruleset - val terrain = resource.terrainsCanBeFoundOn.first() + val terrain = resource.terrainsCanBeFoundOn.first { ruleset.terrains.containsKey(it) } val terrainObject = ruleset.terrains[terrain]!! if (terrainObject.type == TerrainType.TerrainFeature) { tileInfo.baseTerrain =