Fix rematch command for spectators

This commit is contained in:
Trevor Slocum 2023-11-17 11:22:20 -08:00
parent 28ba643bf9
commit 9b8b1767eb

View file

@ -1082,6 +1082,7 @@ COMMANDS:
newGame.Player2 = clientGame.Player2
newGame.allowed1 = clientGame.allowed1
newGame.allowed2 = clientGame.allowed2
copy(newGame.spectators, clientGame.spectators)
s.games = append(s.games, newGame)
clientGame.client1 = nil
@ -1120,6 +1121,10 @@ COMMANDS:
newGame.client2.sendEvent(ev2)
newGame.sendBoard(newGame.client2)
}
for _, spectator := range newGame.spectators {
newGame.sendBoard(spectator)
}
} else {
clientGame.rematch = cmd.client.playerNumber