Hydro plant bugfix

This commit is contained in:
Yair Morgenstern
2018-11-01 20:42:57 +02:00
parent e750207eb5
commit ac6adefdbd

View File

@ -97,9 +97,12 @@ class GameInfo {
civInfo.setTransients()
}
for (civInfo in civilizations)
for (civInfo in civilizations) {
// we have to remove hydro plants from all cities BEFORE we update a single one,
// because updating leads to getting the building uniques from the civ info,
// which in turn leads to us trying to get info on all the building in all the cities...
// which can ail i there's an "unregistered" building anywhere
for (cityInfo in civInfo.cities) {
val cityConstructions = cityInfo.cityConstructions
// As of 2.9.6, removed hydro plant, since it requires rivers, which we do not yet have
if ("Hydro Plant" in cityConstructions.builtBuildings)
@ -108,9 +111,10 @@ class GameInfo {
cityConstructions.currentConstruction = ""
cityConstructions.chooseNextConstruction()
}
cityInfo.cityStats.update()
}
for (cityInfo in civInfo.cities) cityInfo.cityStats.update()
}
}
}