mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 14:02:48 +07:00
Fix issues when adding/removing buildings (#9822)
This commit is contained in:
parent
a705effb7d
commit
4421a2a54e
@ -493,6 +493,9 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
|||||||
builtBuildingObjects = builtBuildingObjects.withItem(building)
|
builtBuildingObjects = builtBuildingObjects.withItem(building)
|
||||||
builtBuildings.add(buildingName)
|
builtBuildings.add(buildingName)
|
||||||
|
|
||||||
|
city.civ.cache.updateCitiesConnectedToCapital(false) // could be a connecting building, like a harbor
|
||||||
|
city.civ.cache.updateCivResources() // this building could be a resource-requiring one
|
||||||
|
|
||||||
/** Support for [UniqueType.CreatesOneImprovement] */
|
/** Support for [UniqueType.CreatesOneImprovement] */
|
||||||
applyCreateOneImprovement(building)
|
applyCreateOneImprovement(building)
|
||||||
|
|
||||||
@ -522,9 +525,6 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
|||||||
city.reassignPopulationDeferred()
|
city.reassignPopulationDeferred()
|
||||||
|
|
||||||
updateUniques()
|
updateUniques()
|
||||||
|
|
||||||
civ.cache.updateCivResources() // this building could be a resource-requiring one
|
|
||||||
civ.cache.updateCitiesConnectedToCapital(false) // could be a connecting building, like a harbor
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun triggerNewBuildingUniques(building: Building) {
|
fun triggerNewBuildingUniques(building: Building) {
|
||||||
@ -551,8 +551,8 @@ class CityConstructions : IsPartOfGameInfoSerialization {
|
|||||||
builtBuildingObjects = builtBuildingObjects.withoutItem(buildingObject)
|
builtBuildingObjects = builtBuildingObjects.withoutItem(buildingObject)
|
||||||
else builtBuildingObjects.removeAll{ it.name == buildingName }
|
else builtBuildingObjects.removeAll{ it.name == buildingName }
|
||||||
builtBuildings.remove(buildingName)
|
builtBuildings.remove(buildingName)
|
||||||
city.civ.cache.updateCivResources() // this building could be a resource-requiring one
|
|
||||||
city.civ.cache.updateCitiesConnectedToCapital(false) // could be a connecting building, like a harbor
|
city.civ.cache.updateCitiesConnectedToCapital(false) // could be a connecting building, like a harbor
|
||||||
|
city.civ.cache.updateCivResources() // this building could be a resource-requiring one
|
||||||
updateUniques()
|
updateUniques()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user