mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-09 15:29:32 +07:00
@ -275,7 +275,7 @@ class CityInfoConquestFunctions(val city: City){
|
||||
// civs so the capitalCityIndicator recognizes the unique buildings of the conquered civ
|
||||
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) }
|
||||
civ = newCivInfo
|
||||
hasJustBeenConquered = false
|
||||
|
@ -772,16 +772,18 @@ class Civilization : IsPartOfGameInfoSerialization {
|
||||
* Removes current capital then moves capital to argument city if not null
|
||||
*/
|
||||
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()
|
||||
|
||||
// Add new capital first so the civ doesn't get stuck in a state where it has cities but no capital
|
||||
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() {
|
||||
val availableCities = cities.filterNot { it.isCapital() }
|
||||
|
Reference in New Issue
Block a user