From e9f1627cc19b83bf715ce4b4ac1e394e20fbd523 Mon Sep 17 00:00:00 2001 From: zikaeroh <48577114+zikaeroh@users.noreply.github.com> Date: Sat, 23 May 2020 19:21:57 -0700 Subject: [PATCH] On new game, mark all players as guessers --- internal/game/room.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/game/room.go b/internal/game/room.go index 3ee7f86..5f2a8ae 100644 --- a/internal/game/room.go +++ b/internal/game/room.go @@ -124,10 +124,15 @@ func (r *Room) NewGame() { panic("not enough words") } - r.Version++ r.Winner = nil r.Turn = Team(r.rand.Intn(len(r.Teams))) r.Board = newBoard(r.Rows, r.Cols, words, r.Turn, len(r.Teams), r.rand) + + for _, p := range r.Players { + p.Spymaster = false + } + + r.Version++ } func (r *Room) EndTurn(id PlayerID) {