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