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!"
|
||||
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) {
|
||||
|
@ -355,7 +355,7 @@ class TileEditorOptionsTable(val mapEditorScreen: MapEditorScreen): Table(Camera
|
||||
// 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 =
|
||||
|
Loading…
x
Reference in New Issue
Block a user