mirror of
https://github.com/yairm210/Unciv.git
synced 2025-09-28 06:16:37 -04:00
Band-aided a bug where players in multiplayer games were waiting for themselves. (#5768)
(cherry picked from commit 22b3997c28da4eb75c1b633625d5c006b17934d8)
This commit is contained in:
parent
0d4da03b7c
commit
099b180a07
@ -120,7 +120,7 @@ class GameInfo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Get a civ by name
|
/** Get a civ by name
|
||||||
* @throws NoSuchElementException if no civ of than name is in the game (alive or dead)! */
|
* @throws NoSuchElementException if no civ of that name is in the game (alive or dead)! */
|
||||||
fun getCivilization(civName: String) = civilizations.first { it.civName == civName }
|
fun getCivilization(civName: String) = civilizations.first { it.civName == civName }
|
||||||
fun getCurrentPlayerCivilization() = currentPlayerCiv
|
fun getCurrentPlayerCivilization() = currentPlayerCiv
|
||||||
fun getCivilizationsAsPreviews() = civilizations.map { it.asPreview() }.toMutableList()
|
fun getCivilizationsAsPreviews() = civilizations.map { it.asPreview() }.toMutableList()
|
||||||
|
@ -335,7 +335,12 @@ class WorldScreen(val gameInfo: GameInfo, val viewingCiv:CivilizationInfo) : Bas
|
|||||||
val latestGame = OnlineMultiplayer().tryDownloadGame(gameInfo.gameId)
|
val latestGame = OnlineMultiplayer().tryDownloadGame(gameInfo.gameId)
|
||||||
|
|
||||||
// if we find the current player didn't change, don't update
|
// if we find the current player didn't change, don't update
|
||||||
if (gameInfo.currentPlayer == latestGame.currentPlayer) {
|
// Additionally, check if we are the current player, and in that case always stop
|
||||||
|
// This fixes a bug where for some reason players were waiting for themselves.
|
||||||
|
if (gameInfo.currentPlayer == latestGame.currentPlayer
|
||||||
|
&& gameInfo.turns == latestGame.turns
|
||||||
|
&& latestGame.currentPlayer != gameInfo.getPlayerToViewAs().civName
|
||||||
|
) {
|
||||||
Gdx.app.postRunnable { loadingGamePopup.close() }
|
Gdx.app.postRunnable { loadingGamePopup.close() }
|
||||||
shouldUpdate = true
|
shouldUpdate = true
|
||||||
return
|
return
|
||||||
|
Loading…
x
Reference in New Issue
Block a user