mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 15:29:32 +07:00
Fixed loading games
This commit is contained in:
@ -288,7 +288,7 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
||||
city.getRuleset().buildings[it]
|
||||
?: throw java.lang.Exception("Building $it is not found!")
|
||||
})
|
||||
updateUniques()
|
||||
updateUniques(true)
|
||||
}
|
||||
|
||||
fun addProductionPoints(productionToAdd: Int) {
|
||||
@ -458,11 +458,11 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
||||
updateUniques()
|
||||
}
|
||||
|
||||
fun updateUniques() {
|
||||
fun updateUniques(onLoadGame:Boolean = false) {
|
||||
builtBuildingUniqueMap.clear()
|
||||
for (building in getBuiltBuildings())
|
||||
builtBuildingUniqueMap.addUniques(building.uniqueObjects)
|
||||
city.cityStats.update()
|
||||
if (!onLoadGame) city.cityStats.update()
|
||||
}
|
||||
|
||||
fun addFreeBuildings() {
|
||||
|
@ -177,14 +177,14 @@ class CityReligionManager : IsPartOfGameInfoSerialization {
|
||||
|
||||
followers.remove(Constants.noReligionName)
|
||||
|
||||
if (followers != previousFollowers)
|
||||
city.cityStats.update()
|
||||
|
||||
if (checkForReligionAdoption) {
|
||||
val newMajorityReligion = getMajorityReligionName()
|
||||
if (oldMajorityReligion != newMajorityReligion && newMajorityReligion != null) {
|
||||
triggerReligionAdoption(newMajorityReligion)
|
||||
}
|
||||
if (followers != previousFollowers)
|
||||
city.cityStats.update()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user