mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-03 21:40:31 +07:00
Buildings missing from ruleset are removed from loaded games *properly*
This commit is contained in:
parent
df03f36207
commit
e58dd7c1f6
@ -66,9 +66,9 @@ object BackwardCompatibility {
|
||||
private fun GameInfo.handleMissingReferencesForEachCity() {
|
||||
for (city in civilizations.asSequence().flatMap { it.cities.asSequence() }) {
|
||||
|
||||
for (building in city.cityConstructions.getBuiltBuildings()) {
|
||||
if (!ruleset.buildings.containsKey(building.name))
|
||||
city.cityConstructions.removeBuilding(building)
|
||||
for (building in city.cityConstructions.builtBuildings.toList()) {
|
||||
if (!ruleset.buildings.containsKey(building))
|
||||
city.cityConstructions.builtBuildings.remove(building)
|
||||
}
|
||||
|
||||
fun isInvalidConstruction(construction: String) =
|
||||
|
Loading…
Reference in New Issue
Block a user