Resolved #9887 - Improvement picker screen does not cause 'phantom' units to be assigned to civ

This commit is contained in:
Yair Morgenstern 2023-08-04 13:35:41 +03:00
parent 915238ed1a
commit 545ff0b944
4 changed files with 6 additions and 4 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 = 897
const val appVersion = "4.7.12-patch1"
const val appCodeNumber = 898
const val appVersion = "4.7.12-patch2"
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.12-patch1", 897)
val VERSION = Version("4.7.12-patch2", 898)
//endregion
lateinit var Current: UncivGame

View File

@ -739,6 +739,8 @@ open class Tile : IsPartOfGameInfoSerialization {
//endregion
//region state-changing functions
/** Do not run this on cloned tiles, since then the cloned *units* will be assigned to the civs
* Instead run setTerrainTransients */
fun setTransients() {
setTerrainTransients()
setUnitTransients(true)

View File

@ -204,7 +204,7 @@ class TileStatFunctions(val tile: Tile) {
val currentStats = getTileStats(city, observingCiv, cityUniqueCache)
val tileClone = tile.clone()
tileClone.setTransients()
tileClone.setTerrainTransients()
if (improvement.name.startsWith(Constants.remove))
tileClone.removeTerrainFeature(improvement.name.removePrefix(Constants.remove))