From 97d5079e68624f842938e4c87386752f1cfda649 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 8 Feb 2023 13:59:57 +0100 Subject: remove card from hand when declaring a play action --- go/game/action.go | 2 -- go/game/state.go | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go/game/action.go b/go/game/action.go index a283bbfb..5002f58a 100644 --- a/go/game/action.go +++ b/go/game/action.go @@ -115,8 +115,6 @@ func NewPlayAction(p *Player, c *Card, args ...interface{}) *PlayAction { a.targets = newTargets(s, []string{}, a) } - p.Hand.RemoveCard(c) - a.resolveFunc = func(s *State) { s.resolvePlay(p, c, a.targets) } diff --git a/go/game/state.go b/go/game/state.go index 7a54ddc0..98ac9c31 100644 --- a/go/game/state.go +++ b/go/game/state.go @@ -243,6 +243,9 @@ func (s *State) DeclareAction(a Action) { } if err == nil { + if pa, ok := a.(*PlayAction); ok { + pa.Source().(*Player).Hand.RemoveCard(pa.Card) + } s.pushAction(a) } -- cgit v1.2.3