Skip to content

Commit

Permalink
Fixes #344
Browse files Browse the repository at this point in the history
  • Loading branch information
Bios-Marcel committed Oct 19, 2024
1 parent db68899 commit 692f358
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/game/lobby.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,12 @@ func (lobby *Lobby) handleToggleReadinessEvent(player *Player) {
}

func (lobby *Lobby) readyToStart() bool {
// Otherwise the game will start and gameover instantly. This can happen
// if a lobby is created and the owner refreshes.
if !lobby.HasConnectedPlayers() {
return false
}

for _, otherPlayer := range lobby.players {
if otherPlayer.Connected && otherPlayer.State != Ready {
return false
Expand Down

0 comments on commit 692f358

Please sign in to comment.