mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 22:37:02 -04:00
Fixed some more silly bugs caused by badly configured mods
This commit is contained in:
parent
88eab17e9e
commit
2a82482d05
@ -258,12 +258,24 @@ class Ruleset {
|
|||||||
lines += "${resource.name} revealed by tech ${resource.revealedBy} which does not exist!"
|
lines += "${resource.name} revealed by tech ${resource.revealedBy} which does not exist!"
|
||||||
if (resource.improvement != null && !tileImprovements.containsKey(resource.improvement!!))
|
if (resource.improvement != null && !tileImprovements.containsKey(resource.improvement!!))
|
||||||
lines += "${resource.name} improved by improvement ${resource.improvement} which does not exist!"
|
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) {
|
for (improvement in tileImprovements.values) {
|
||||||
if (improvement.techRequired != null && !technologies.containsKey(improvement.techRequired!!))
|
if (improvement.techRequired != null && !technologies.containsKey(improvement.techRequired!!))
|
||||||
lines += "${improvement.name} requires tech ${improvement.techRequired} which does not exist!"
|
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 (tech in technologies.values) {
|
||||||
for (prereq in tech.prerequisites) {
|
for (prereq in tech.prerequisites) {
|
||||||
|
@ -342,7 +342,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
val resources = ArrayList<Actor>()
|
val resources = ArrayList<Actor>()
|
||||||
resources.add(getHex(Color.WHITE, getCrossedResource()).apply {
|
resources.add(getHex(Color.WHITE, getCrossedResource()).apply {
|
||||||
onClick {
|
onClick {
|
||||||
tileAction = {it.resource=null}
|
tileAction = { it.resource = null }
|
||||||
setCurrentHex(getHex(Color.WHITE, getCrossedResource()), "Clear resource")
|
setCurrentHex(getHex(Color.WHITE, getCrossedResource()), "Clear resource")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -350,12 +350,12 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
|||||||
for (resource in ruleset.tileResources.values) {
|
for (resource in ruleset.tileResources.values) {
|
||||||
val resourceHex = getHex(Color.WHITE, ImageGetter.getResourceImage(resource.name, 40f))
|
val resourceHex = getHex(Color.WHITE, ImageGetter.getResourceImage(resource.name, 40f))
|
||||||
resourceHex.onClick {
|
resourceHex.onClick {
|
||||||
tileAction = {it.resource = resource.name}
|
tileAction = { it.resource = resource.name }
|
||||||
|
|
||||||
// for the tile image
|
// for the tile image
|
||||||
val tileInfo = TileInfo()
|
val tileInfo = TileInfo()
|
||||||
tileInfo.ruleset = mapEditorScreen.ruleset
|
tileInfo.ruleset = mapEditorScreen.ruleset
|
||||||
val terrain = resource.terrainsCanBeFoundOn.first()
|
val terrain = resource.terrainsCanBeFoundOn.first { ruleset.terrains.containsKey(it) }
|
||||||
val terrainObject = ruleset.terrains[terrain]!!
|
val terrainObject = ruleset.terrains[terrain]!!
|
||||||
if (terrainObject.type == TerrainType.TerrainFeature) {
|
if (terrainObject.type == TerrainType.TerrainFeature) {
|
||||||
tileInfo.baseTerrain =
|
tileInfo.baseTerrain =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user