aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-09-03 15:00:24 +0200
committerFlorian Fischer <florian.fischer@muhq.space>2025-09-03 15:00:24 +0200
commit3f7c337eccaa81550bf7f13f32c041e5c35fd3a2 (patch)
tree584fbdc2568e954f40d18396ee5b354ac13ecb8e
parentb0d2ca8ccb8b42d8da23ae014d154dfde9f1cf08 (diff)
downloadmuhqs-game-3f7c337eccaa81550bf7f13f32c041e5c35fd3a2.tar.gz
muhqs-game-3f7c337eccaa81550bf7f13f32c041e5c35fd3a2.zip
fix buying cads from store tiles not removing the cards
-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 {