aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/game/action.go14
1 files changed, 13 insertions, 1 deletions
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 {