mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-14 01:39:40 +07:00
@ -275,7 +275,7 @@ class CityInfoConquestFunctions(val city: City){
|
|||||||
// civs so the capitalCityIndicator recognizes the unique buildings of the conquered civ
|
// civs so the capitalCityIndicator recognizes the unique buildings of the conquered civ
|
||||||
if (oldCiv.getCapital() == this) oldCiv.moveCapitalToNextLargest()
|
if (oldCiv.getCapital() == this) oldCiv.moveCapitalToNextLargest()
|
||||||
|
|
||||||
civ.cities = civ.cities.toMutableList().apply { remove(city) }
|
oldCiv.cities = oldCiv.cities.toMutableList().apply { remove(city) }
|
||||||
newCivInfo.cities = newCivInfo.cities.toMutableList().apply { add(city) }
|
newCivInfo.cities = newCivInfo.cities.toMutableList().apply { add(city) }
|
||||||
civ = newCivInfo
|
civ = newCivInfo
|
||||||
hasJustBeenConquered = false
|
hasJustBeenConquered = false
|
||||||
|
@ -772,15 +772,17 @@ class Civilization : IsPartOfGameInfoSerialization {
|
|||||||
* Removes current capital then moves capital to argument city if not null
|
* Removes current capital then moves capital to argument city if not null
|
||||||
*/
|
*/
|
||||||
fun moveCapitalTo(city: City?) {
|
fun moveCapitalTo(city: City?) {
|
||||||
if (cities.isNotEmpty() && getCapital() != null) {
|
|
||||||
val oldCapital = getCapital()!!
|
|
||||||
oldCapital.cityConstructions.removeBuilding(oldCapital.capitalCityIndicator())
|
|
||||||
}
|
|
||||||
|
|
||||||
if (city == null) return // can't move a non-existent city but we can always remove our old capital
|
val oldCapital = getCapital()
|
||||||
// move new capital
|
|
||||||
city.cityConstructions.addBuilding(city.capitalCityIndicator())
|
// Add new capital first so the civ doesn't get stuck in a state where it has cities but no capital
|
||||||
city.isBeingRazed = false // stop razing the new capital if it was being razed
|
if (city != null) {
|
||||||
|
// move new capital
|
||||||
|
city.cityConstructions.addBuilding(city.capitalCityIndicator())
|
||||||
|
city.isBeingRazed = false // stop razing the new capital if it was being razed
|
||||||
|
}
|
||||||
|
if (oldCapital != null)
|
||||||
|
oldCapital.cityConstructions.removeBuilding(oldCapital.capitalCityIndicator())
|
||||||
}
|
}
|
||||||
|
|
||||||
fun moveCapitalToNextLargest() {
|
fun moveCapitalToNextLargest() {
|
||||||
|
Reference in New Issue
Block a user