From a504a91ef4ed49ba451de14f04ef02472dfcb189 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Fri, 27 Dec 2024 12:41:38 +0100 Subject: improve and fix slow action timing check Do not allow to declare slow play actions in the client. Fix the slow action check in the game state. --- go/game/state.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'go/game') diff --git a/go/game/state.go b/go/game/state.go index cf7b7111..577a0cb8 100644 --- a/go/game/state.go +++ b/go/game/state.go @@ -424,7 +424,7 @@ func (s *LocalState) declareAction(a Action) { err = a.CheckTargets(s) - if err != nil { + if err == nil { switch a.(type) { case *BuyAction: if s.activePhase != Phases.BuyPhase { @@ -446,9 +446,11 @@ func (s *LocalState) declareAction(a Action) { } s.broadcastNotification(newDeclaredActionNotification(a, err)) - t := a.Targets() - if t != nil { - s.events = append(s.events, newTargetEvent(a, t)) + if err == nil { + t := a.Targets() + if t != nil { + s.events = append(s.events, newTargetEvent(a, t)) + } } } -- cgit v1.2.3