4.6.11-patch1 (#9375)

* Convert 'camps' vectorhashmap to 'encampments' arraylist

* Solve camps For Real This Time
Previous solution was only taking the first item of the class, not all of it

* 4.6.11-patch1
This commit is contained in:
Yair Morgenstern
2023-05-11 16:54:37 +03:00
committed by GitHub
parent dde3732383
commit d2eaae0922
3 changed files with 9 additions and 7 deletions

View File

@ -41,15 +41,15 @@ import com.unciv.ui.screens.worldscreen.PlayerReadyScreen
import com.unciv.ui.screens.worldscreen.WorldMapHolder
import com.unciv.ui.screens.worldscreen.WorldScreen
import com.unciv.ui.screens.worldscreen.unit.UnitTable
import com.unciv.utils.Concurrency
import com.unciv.utils.DebugUtils
import com.unciv.utils.Display
import com.unciv.utils.Log
import com.unciv.utils.PlatformSpecific
import com.unciv.utils.Concurrency
import com.unciv.utils.debug
import com.unciv.utils.launchOnGLThread
import com.unciv.utils.withGLContext
import com.unciv.utils.withThreadPoolContext
import com.unciv.utils.debug
import kotlinx.coroutines.CancellationException
import java.io.PrintWriter
import java.util.*
@ -531,7 +531,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.6.11", 865)
val VERSION = Version("4.6.11-patch1", 866)
//endregion
lateinit var Current: UncivGame

View File

@ -58,8 +58,10 @@ class NonStringKeyMapSerializer<MT: MutableMap<KT, Any>, KT>(
val isOldEncampment = entry.child.next.child.run {
name == "class" && isString && asString() == "com.unciv.logic.Encampment"
}
val value = if (isOldEncampment)
json.readValue(Encampment::class.java, entry.child.next.child.next)
val value = if (isOldEncampment) {
entry.child.next.remove("class")
json.readValue(Encampment::class.java, entry.child.next)
}
else json.readValue<Any>(null, entry.child.next)
result[key!!] = value!!