From aff3efe57fee5d4055bca3d1ab88ed45cb6fb899 Mon Sep 17 00:00:00 2001 From: GGGuenni Date: Mon, 12 Apr 2021 13:28:17 +0200 Subject: [PATCH] Fixed "refresh list" not updating the savegame correctly --- core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt b/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt index 3e26f6bdb8..1d05a39549 100644 --- a/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt +++ b/core/src/com/unciv/ui/multiplayer/MultiplayerScreen.kt @@ -295,15 +295,16 @@ class MultiplayerScreen(previousScreen: CameraStageBaseScreen) : PickerScreen() //One thread for all downloads thread(name = "multiplayerGameDownload") { - for (entry in multiplayerGames) { + for ((fileHandle, gameInfo) in multiplayerGames) { try { - val game = OnlineMultiplayer().tryDownloadGame(entry.value.gameId) - GameSaver.saveGame(game, entry.key.name(), true) + val game = OnlineMultiplayer().tryDownloadGame(gameInfo.gameId) + GameSaver.saveGame(game, fileHandle.name(), true) + multiplayerGames[fileHandle] = game } catch (ex: Exception) { //skipping one is not fatal //Trying to use as many prev. used strings as possible Gdx.app.postRunnable { - ToastPopup("Could not download game!" + " ${entry.key.name()}", this) + ToastPopup("Could not download game!" + " ${fileHandle.name()}", this) } continue }