mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-29 15:01:09 -04:00
Resolved #5727 - on multiplayer, game info is updated as each intermediate player finishes their turn
This commit is contained in:
parent
9950e963bc
commit
623420039b
@ -334,12 +334,13 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Bas
|
|||||||
try {
|
try {
|
||||||
val latestGame = OnlineMultiplayer().tryDownloadGame(gameInfo.gameId)
|
val latestGame = OnlineMultiplayer().tryDownloadGame(gameInfo.gameId)
|
||||||
|
|
||||||
// if we find it still isn't player's turn...nothing changed
|
// if we find the current player didn't change, don't update
|
||||||
if (viewingCiv.playerId != latestGame.getCurrentPlayerCivilization().playerId) {
|
if (gameInfo.currentPlayer != latestGame.currentPlayer) {
|
||||||
Gdx.app.postRunnable { loadingGamePopup.close() }
|
Gdx.app.postRunnable { loadingGamePopup.close() }
|
||||||
shouldUpdate = true
|
shouldUpdate = true
|
||||||
return
|
return
|
||||||
} else { //else we found it is the player's turn again, turn off polling and load turn
|
} else { // if the game updated, even if it's not our turn, reload the world -
|
||||||
|
// stuff has changed and the "waiting for X" will now show the correct civ
|
||||||
stopMultiPlayerRefresher()
|
stopMultiPlayerRefresher()
|
||||||
latestGame.isUpToDate = true
|
latestGame.isUpToDate = true
|
||||||
Gdx.app.postRunnable { createNewWorldScreen(latestGame) }
|
Gdx.app.postRunnable { createNewWorldScreen(latestGame) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user