diff --git a/core/src/com/unciv/logic/GameInfo.kt b/core/src/com/unciv/logic/GameInfo.kt index ea0cac3ff0..6ac9351f36 100644 --- a/core/src/com/unciv/logic/GameInfo.kt +++ b/core/src/com/unciv/logic/GameInfo.kt @@ -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() + } } } \ No newline at end of file