mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-27 13:55:54 -04:00
4.7.6-patch1
Captured 'last city' capitals do not retain capital status
This commit is contained in:
parent
f7295884e6
commit
6f0a51d6d8
@ -4,8 +4,8 @@ package com.unciv.build
|
|||||||
object BuildConfig {
|
object BuildConfig {
|
||||||
const val kotlinVersion = "1.8.21"
|
const val kotlinVersion = "1.8.21"
|
||||||
const val appName = "Unciv"
|
const val appName = "Unciv"
|
||||||
const val appCodeNumber = 886
|
const val appCodeNumber = 887
|
||||||
const val appVersion = "4.7.6"
|
const val appVersion = "4.7.6-patch1"
|
||||||
|
|
||||||
const val gdxVersion = "1.11.0"
|
const val gdxVersion = "1.11.0"
|
||||||
const val ktorVersion = "2.2.3"
|
const val ktorVersion = "2.2.3"
|
||||||
|
@ -536,7 +536,7 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
//region AUTOMATICALLY GENERATED VERSION DATA - DO NOT CHANGE THIS REGION, INCLUDING THIS COMMENT
|
//region AUTOMATICALLY GENERATED VERSION DATA - DO NOT CHANGE THIS REGION, INCLUDING THIS COMMENT
|
||||||
val VERSION = Version("4.7.6", 886)
|
val VERSION = Version("4.7.6-patch1", 887)
|
||||||
//endregion
|
//endregion
|
||||||
|
|
||||||
lateinit var Current: UncivGame
|
lateinit var Current: UncivGame
|
||||||
|
@ -457,9 +457,7 @@ class City : IsPartOfGameInfoSerialization {
|
|||||||
|
|
||||||
// Move the capital if destroyed (by a nuke or by razing)
|
// Move the capital if destroyed (by a nuke or by razing)
|
||||||
// Must be before removing existing capital because we may be annexing a puppet which means city stats update - see #8337
|
// Must be before removing existing capital because we may be annexing a puppet which means city stats update - see #8337
|
||||||
if (isCapital() && civ.cities.size > 1) {
|
if (isCapital()) civ.moveCapitalToNextLargest()
|
||||||
civ.moveCapitalToNextLargest()
|
|
||||||
}
|
|
||||||
|
|
||||||
civ.cities = civ.cities.toMutableList().apply { remove(this@City) }
|
civ.cities = civ.cities.toMutableList().apply { remove(this@City) }
|
||||||
getCenterTile().changeImprovement("City ruins")
|
getCenterTile().changeImprovement("City ruins")
|
||||||
|
@ -815,7 +815,11 @@ class Civilization : IsPartOfGameInfoSerialization {
|
|||||||
|
|
||||||
fun moveCapitalToNextLargest() {
|
fun moveCapitalToNextLargest() {
|
||||||
val availableCities = cities.filterNot { it.isCapital() }
|
val availableCities = cities.filterNot { it.isCapital() }
|
||||||
if (availableCities.none()) return
|
if (availableCities.none()) {
|
||||||
|
moveCapitalTo(null)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
var newCapital = availableCities.filterNot { it.isPuppet }.maxByOrNull { it.population.population }
|
var newCapital = availableCities.filterNot { it.isPuppet }.maxByOrNull { it.population.population }
|
||||||
|
|
||||||
if (newCapital == null) { // No non-puppets, take largest puppet and annex
|
if (newCapital == null) { // No non-puppets, take largest puppet and annex
|
||||||
|
Loading…
x
Reference in New Issue
Block a user