From 3f7c337eccaa81550bf7f13f32c041e5c35fd3a2 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 3 Sep 2025 15:00:24 +0200 Subject: fix buying cads from store tiles not removing the cards --- go/game/action.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'go/game') diff --git a/go/game/action.go b/go/game/action.go index f371aae6..d82bf56a 100644 --- a/go/game/action.go +++ b/go/game/action.go @@ -730,7 +730,19 @@ func (a *BuyAction) CheckTargets(s *LocalState) error { } func (a *BuyAction) resolve(s *LocalState) { - a.player.Store.MoveCard(a.card(), a.player.DiscardPile) + c := a.card() + p := a.Controller() + if p.Store.Contains(c) { + p.Store.MoveCard(c, p.DiscardPile) + // Card from a store on the map + } else { + for _, s := range p.AvailableStores() { + if s.Contains(c) { + s.MoveCard(c, p.DiscardPile) + return + } + } + } } func (a *BuyAction) PayCosts(s *LocalState) bool { -- cgit v1.2.3