mirror of
https://github.com/yairm210/Unciv.git
synced 2025-07-30 14:48:56 +07:00
Band-aided a bug where players in multiplayer games were waiting for themselves. (#5768)
This commit is contained in:
@ -120,7 +120,7 @@ class GameInfo {
|
||||
}
|
||||
|
||||
/** 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 getCurrentPlayerCivilization() = currentPlayerCiv
|
||||
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)
|
||||
|
||||
// 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() }
|
||||
shouldUpdate = true
|
||||
return
|
||||
|
Reference in New Issue
Block a user