mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 15:01:09 -04: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 (isNationalWonder) {
|
||||||
if (civInfo.cities.any { it.cityConstructions.isBuilt(name) })
|
if (civInfo.cities.any { it.cityConstructions.isBuilt(name) })
|
||||||
return "National Wonder is already built"
|
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
|
if (requiredBuildingInAllCities != null
|
||||||
&& civInfo.cities.any {
|
&& civInfo.cities.any {
|
||||||
!it.isPuppet && !it.cityConstructions
|
!it.isPuppet && !it.cityConstructions
|
||||||
|
@ -273,6 +273,8 @@ class Ruleset {
|
|||||||
lines += "${building.name} replaces ${building.replaces} which does not exist!"
|
lines += "${building.name} replaces ${building.replaces} which does not exist!"
|
||||||
if (building.requiredBuilding != null && !buildings.containsKey(building.requiredBuilding!!))
|
if (building.requiredBuilding != null && !buildings.containsKey(building.requiredBuilding!!))
|
||||||
lines += "${building.name} requires ${building.requiredBuilding} which does not exist!"
|
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) {
|
for (resource in tileResources.values) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user