mirror of
https://github.com/yairm210/Unciv.git
synced 2025-02-11 11:28:03 +07:00
Fixed assumption that the current game is in the list of games gathered from preview files (#5981)
This commit is contained in:
parent
b1517f0cde
commit
b813e0b38a
@ -186,7 +186,11 @@ class MultiplayerTurnCheckWorker(appContext: Context, workerParams: WorkerParame
|
||||
|
||||
if (currentGameInfo.currentPlayerCiv.playerId == settings.userId) {
|
||||
// May be useful to remind a player that he forgot to complete his turn.
|
||||
notifyUserAboutTurn(applicationContext, gameNames[gameIds.indexOf(currentGameInfo.gameId)])
|
||||
val gameIndex = gameIds.indexOf(currentGameInfo.gameId)
|
||||
// Of the turnNotification is OFF, this will be -1 since we never saved this game in the array
|
||||
// Or possibly reading the preview file returned an exception
|
||||
if (gameIndex!=-1)
|
||||
notifyUserAboutTurn(applicationContext, gameNames[gameIndex])
|
||||
} else {
|
||||
val inputData = workDataOf(Pair(FAIL_COUNT, 0), Pair(GAME_ID, gameIds), Pair(GAME_NAME, gameNames),
|
||||
Pair(USER_ID, settings.userId), Pair(CONFIGURED_DELAY, settings.multiplayerTurnCheckerDelayInMinutes),
|
||||
|
Loading…
Reference in New Issue
Block a user