Solved crash for badly defined mods like REKmod

This commit is contained in:
Yair Morgenstern
2021-02-25 19:25:04 +02:00
parent bfea689261
commit d6e75c7ea2

View File

@ -230,8 +230,9 @@ open class TileInfo {
val resource = getTileResource()
stats.add(getTileResource()) // resource base
if (resource.building != null && city != null && city.cityConstructions.isBuilt(resource.building!!)) {
val resourceBuilding = tileMap.gameInfo.ruleSet.buildings[resource.building!!]!!
stats.add(resourceBuilding.resourceBonusStats!!) // resource-specific building (eg forge, stable) bonus
val resourceBuilding = tileMap.gameInfo.ruleSet.buildings[resource.building!!]
if (resourceBuilding != null && resourceBuilding.resourceBonusStats != null)
stats.add(resourceBuilding.resourceBonusStats!!) // resource-specific building (eg forge, stable) bonus
}
}