mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 11:10:42 +00:00
fix: don't report game as Lobby phase when players leave mid-game
After a player left, the server would fall back to Lobby phase if player count dropped below the max — even if the game had already started. Now checks hasStarted() before reporting Lobby phase.
This commit is contained in:
@@ -817,7 +817,7 @@ export class GameServer {
|
||||
this.gameConfig.gameType === GameType.Public &&
|
||||
this.gameConfig.maxPlayers &&
|
||||
this.activeClients.length < this.gameConfig.maxPlayers;
|
||||
if (lessThanLifetime && notEnoughPlayers) {
|
||||
if (lessThanLifetime && notEnoughPlayers && !this.hasStarted()) {
|
||||
return GamePhase.Lobby;
|
||||
}
|
||||
const warmupOver = now > this.startsAt! + 30 * 1000;
|
||||
|
||||
Reference in New Issue
Block a user