From 5d6bfbfb319795bbdc70a9eb2cbdd69f2c4c430b Mon Sep 17 00:00:00 2001 From: GGGuenni Date: Tue, 30 Mar 2021 17:14:07 +0200 Subject: [PATCH] Fixed can't press nextTurn in multiplayer game (#3748) * Fixed game crashes on create multiplayer game * Update isPlayersTurn on update() --- core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt | 2 +- core/src/com/unciv/ui/worldscreen/WorldScreen.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt index fadccf82fc..5018f677ca 100644 --- a/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt +++ b/core/src/com/unciv/ui/newgamescreen/NewGameScreen.kt @@ -148,7 +148,7 @@ class NewGameScreen(previousScreen:CameraStageBaseScreen, _gameSetupInfo: GameSe // Save gameId to clipboard because you have to do it anyway. Gdx.app.clipboard.contents = newGame!!.gameId // Popup to notify the User that the gameID got copied to the clipboard - Gdx.app.postRunnable { ToastPopup("gameID copied to clipboard".tr(), UncivGame.Current.worldScreen, 2500) } + Gdx.app.postRunnable { ToastPopup("gameID copied to clipboard".tr(), game.worldScreen, 2500) } GameSaver.autoSave(newGame!!) {} diff --git a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt index 156b8c3a4d..18d1c8aa08 100644 --- a/core/src/com/unciv/ui/worldscreen/WorldScreen.kt +++ b/core/src/com/unciv/ui/worldscreen/WorldScreen.kt @@ -312,6 +312,7 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Cam techPolicyAndVictoryHolder.setPosition(10f, topBar.y - techPolicyAndVictoryHolder.height - 5f) updateDiplomacyButton(viewingCiv) + isPlayersTurn = viewingCiv == gameInfo.currentPlayerCiv if (!hasOpenPopups() && isPlayersTurn) { when {