Buildings missing from ruleset are removed from loaded games *properly*

This commit is contained in:
Yair Morgenstern 2023-09-04 16:42:21 +03:00
parent df03f36207
commit e58dd7c1f6

View File

@ -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) =