From 2863f09e46ba923daea3761a8b0342dc38029530 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 8 Sep 2025 22:32:49 +0200 Subject: fix target options not considering declared actions --- go/game/targets.go | 4 ++++ go/game/targets_test.go | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/go/game/targets.go b/go/game/targets.go index 92fc6104..ba676677 100644 --- a/go/game/targets.go +++ b/go/game/targets.go @@ -948,5 +948,9 @@ func (t *Target) candidates() []any { c = append(c, utils.TypedSliceToInterfaceSlice(cards.Cards())...) } + if strings.Contains(t.desc, "declared") { + c = append(c, utils.TypedSliceToInterfaceSlice(t.s.stack.Actions)...) + } + return c } diff --git a/go/game/targets_test.go b/go/game/targets_test.go index 134eef5f..ea511cf8 100644 --- a/go/game/targets_test.go +++ b/go/game/targets_test.go @@ -286,6 +286,10 @@ func TestSpellConstraint(t *testing.T) { desc = newTargetDesc("declared spell") target = newTarget(s, desc, NewPassPriority(p)) + if !utils.InterfaceSliceContains(target.Options(), declaredSpell) { + t.Fatal("options does not contain the declared spell") + } + if err := target.AddSelection(declaredSpell); err != nil { t.Fatal("failed to target spell:", err) } -- cgit v1.2.3