mirror of
https://github.com/yairm210/Unciv.git
synced 2025-01-07 14:02:48 +07:00
One player in each round will be processed even if all players are defeated. (#10788)
This commit is contained in:
parent
d3ac2c5ede
commit
d1bb563333
@ -362,11 +362,25 @@ class GameInfo : IsPartOfGameInfoSerialization, HasGameInfoSerializationVersion
|
||||
|
||||
val isOnline = gameParameters.isOnlineMultiplayer
|
||||
|
||||
// Skip the player if we are playing hotseat
|
||||
// If all hotseat players are defeated then skip all but the first one
|
||||
fun shouldAutoProcessHotseatPlayer(): Boolean =
|
||||
!isOnline &&
|
||||
player.isDefeated() && (civilizations.any { it.isHuman() && it.isAlive() }
|
||||
|| civilizations.first { it.isHuman() } != player)
|
||||
|
||||
// Skip all spectators and defeated players
|
||||
// If all players are defeated then let the first player control next turn
|
||||
fun shouldAutoProcessOnlinePlayer(): Boolean =
|
||||
isOnline && (player.isSpectator() || player.isDefeated() &&
|
||||
(civilizations.any { it.isHuman() && it.isAlive() }
|
||||
|| civilizations.first { it.isHuman() } != player))
|
||||
|
||||
// We process player automatically if:
|
||||
while (isSimulation() || // simulation is active
|
||||
player.isAI() || // or player is AI
|
||||
player.isDefeated() ||
|
||||
isOnline && player.isSpectator()) // or player is online spectator
|
||||
shouldAutoProcessHotseatPlayer() || // or a player is defeated in hotseat
|
||||
shouldAutoProcessOnlinePlayer()) // or player is online spectator
|
||||
{
|
||||
|
||||
// Starting preparations
|
||||
@ -391,12 +405,12 @@ class GameInfo : IsPartOfGameInfoSerialization, HasGameInfoSerializationVersion
|
||||
if (turns == DebugUtils.SIMULATE_UNTIL_TURN)
|
||||
DebugUtils.SIMULATE_UNTIL_TURN = 0
|
||||
|
||||
// We found human player, so we are making him current
|
||||
// We found a human player, so we are making them current
|
||||
currentTurnStartTime = System.currentTimeMillis()
|
||||
currentPlayer = player.civName
|
||||
currentPlayerCiv = getCivilization(currentPlayer)
|
||||
|
||||
// Starting his turn
|
||||
// Starting their turn
|
||||
TurnManager(player).startTurn(progressBar)
|
||||
|
||||
// No popups for spectators
|
||||
|
Loading…
Reference in New Issue
Block a user