mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-19 12:18:53 +07:00
Game no longer crashes due to incorrect building-improvement modding combinations
This commit is contained in:
@ -469,7 +469,7 @@ class Building : NamedStats(), IConstruction {
|
||||
val improvementUnique = uniqueObjects
|
||||
.firstOrNull { it.placeholderText == "Creates a [] improvement on a specific tile" }
|
||||
if (improvementUnique == null) return null
|
||||
return ruleset.tileImprovements[improvementUnique.params[0]]!!
|
||||
return ruleset.tileImprovements[improvementUnique.params[0]]
|
||||
}
|
||||
|
||||
fun isSellable() = !isWonder && !isNationalWonder && !uniques.contains("Unsellable")
|
||||
|
@ -278,6 +278,9 @@ class Ruleset {
|
||||
lines += "${building.name} requires ${building.requiredBuildingInAllCities} in all cities which does not exist!"
|
||||
if (building.providesFreeBuilding != null && !buildings.containsKey(building.providesFreeBuilding!!))
|
||||
lines += "${building.name} provides a free ${building.providesFreeBuilding} which does not exist!"
|
||||
for (unique in building.uniqueObjects)
|
||||
if (unique.placeholderText == "Creates a [] improvement on a specific tile" && !tileImprovements.containsKey(unique.params[0]))
|
||||
lines += "${building.name} creates a ${unique.params[0]} improvement which does not exist!"
|
||||
}
|
||||
|
||||
for (resource in tileResources.values) {
|
||||
|
Reference in New Issue
Block a user