From 351e5eebc63363af3a8076e06a93bd1cb6cc3b79 Mon Sep 17 00:00:00 2001 From: stryan Date: Sun, 26 Sep 2021 14:05:15 -0400 Subject: [PATCH] if the other player is already readyed up, start the game --- internal/game/game.go | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/internal/game/game.go b/internal/game/game.go index 4349164..1475bcd 100644 --- a/internal/game/game.go +++ b/internal/game/game.go @@ -158,6 +158,11 @@ func (g *Game) PlayerStateAct(id int, cmd string) *GameView { return NewView(id, g) case "b": //begin game + if id == SentinalID { + g.SentinalPlayer.Ready = true + } else if id == ScourgeID { + g.ScourgePlayer.Ready = true + } if g.SentinalPlayer.Ready && g.ScourgePlayer.Ready && g.Status == StatusLobby { g.Status = StatusReady if id == SentinalID { @@ -175,12 +180,6 @@ func (g *Game) PlayerStateAct(id int, cmd string) *GameView { g.ScourgeDeck.Cards = g.ScourgeDeck.Cards[0 : len(g.ScourgeDeck.Cards)-5] g.CurrentTurn = ScourgeID } - } else { - if id == SentinalID { - g.SentinalPlayer.Ready = true - } else if id == ScourgeID { - g.ScourgePlayer.Ready = true - } } case "s": //start turn