4.7.6-patch1

Captured 'last city' capitals do not retain capital status
This commit is contained in:
Yair Morgenstern 2023-07-02 17:36:38 +03:00
parent f7295884e6
commit 6f0a51d6d8
4 changed files with 9 additions and 7 deletions

View File

@ -4,8 +4,8 @@ package com.unciv.build
object BuildConfig {
const val kotlinVersion = "1.8.21"
const val appName = "Unciv"
const val appCodeNumber = 886
const val appVersion = "4.7.6"
const val appCodeNumber = 887
const val appVersion = "4.7.6-patch1"
const val gdxVersion = "1.11.0"
const val ktorVersion = "2.2.3"

View File

@ -536,7 +536,7 @@ open class UncivGame(val isConsoleMode: Boolean = false) : Game(), PlatformSpeci
companion object {
//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
lateinit var Current: UncivGame

View File

@ -457,9 +457,7 @@ class City : IsPartOfGameInfoSerialization {
// 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
if (isCapital() && civ.cities.size > 1) {
civ.moveCapitalToNextLargest()
}
if (isCapital()) civ.moveCapitalToNextLargest()
civ.cities = civ.cities.toMutableList().apply { remove(this@City) }
getCenterTile().changeImprovement("City ruins")

View File

@ -815,7 +815,11 @@ class Civilization : IsPartOfGameInfoSerialization {
fun moveCapitalToNextLargest() {
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 }
if (newCapital == null) { // No non-puppets, take largest puppet and annex