mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-23 13:10:54 +07:00
Can handle and detect mods where the requiredBuildingInAllRuleset does not exist in the ruleset
This commit is contained in:
parent
b27c744cd2
commit
245e7de0a1
@ -307,6 +307,8 @@ class Building : NamedStats(), IConstruction {
|
||||
if (isNationalWonder) {
|
||||
if (civInfo.cities.any { it.cityConstructions.isBuilt(name) })
|
||||
return "National Wonder is already built"
|
||||
if (requiredBuildingInAllCities != null && civInfo.gameInfo.ruleSet.buildings[requiredBuildingInAllCities!!] == null)
|
||||
return "Required building in all cities does not exist in the ruleset!"
|
||||
if (requiredBuildingInAllCities != null
|
||||
&& civInfo.cities.any {
|
||||
!it.isPuppet && !it.cityConstructions
|
||||
|
@ -273,6 +273,8 @@ class Ruleset {
|
||||
lines += "${building.name} replaces ${building.replaces} which does not exist!"
|
||||
if (building.requiredBuilding != null && !buildings.containsKey(building.requiredBuilding!!))
|
||||
lines += "${building.name} requires ${building.requiredBuilding} which does not exist!"
|
||||
if (building.requiredBuildingInAllCities != null && !buildings.containsKey(building.requiredBuildingInAllCities!!))
|
||||
lines += "${building.name} requires ${building.requiredBuildingInAllCities} in all cities which does not exist!"
|
||||
}
|
||||
|
||||
for (resource in tileResources.values) {
|
||||
|
Loading…
Reference in New Issue
Block a user