From 76195d21cbd292dde818cc469df204304e5eef54 Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Sat, 3 Feb 2024 13:36:06 -0600 Subject: [PATCH] why do cuffs not work --- game/game.go | 2 ++ game/player.go | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/game/game.go b/game/game.go index fa9229c..8f90495 100644 --- a/game/game.go +++ b/game/game.go @@ -11,6 +11,7 @@ package game import ( "errors" + "log/slog" "git.sunturtle.xyz/studio/shotgun/player" "git.sunturtle.xyz/studio/shotgun/serve" @@ -94,6 +95,7 @@ func (g *Match) NextTurn() { g.reveal = false cur := g.CurrentPlayer() skip := cur.cuffs == CuffedSkip + slog.Info("next turn", "skip", skip, "cuffs", cur.cuffs) cur.cuffs = cur.cuffs.NextState() if skip { g.NextTurn() diff --git a/game/player.go b/game/player.go index cd0a4a7..e98e42f 100644 --- a/game/player.go +++ b/game/player.go @@ -56,6 +56,8 @@ const ( ) func (c CuffState) NextState() CuffState { - var m = [...]CuffState{Uncuffed, Uncuffed, Cuffed} - return m[c] + if c != Uncuffed { + c-- + } + return c }