From 8d0e7f5f3faab22d2f96ed00ba89467f067fd9d9 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 21 Jul 2025 08:29:20 -0400 Subject: fix Target.AllowSelection for '*' avtions --- go/game/targets.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/go/game/targets.go b/go/game/targets.go index 1be206e7..bcb47d50 100644 --- a/go/game/targets.go +++ b/go/game/targets.go @@ -202,9 +202,11 @@ func (t *Target) AddSelection(sel any) (err error) { return } -func (t *Target) RequireSelection() bool { return len(t.sel) < t.requirement.min } -func (t *Target) HasSelection() bool { return len(t.sel) > 0 } -func (t *Target) AllowSelection() bool { return len(t.sel) < t.requirement.max } +func (t *Target) RequireSelection() bool { return len(t.sel) < t.requirement.min } +func (t *Target) HasSelection() bool { return len(t.sel) > 0 } +func (t *Target) AllowSelection() bool { + return (t.requirement.max == -1 || len(t.sel) < t.requirement.max) && len(t.Options()) > 0 +} func (t *Target) ClearSelection() { t.sel = []interface{}{} } func (t *Target) NoSelection() bool { return len(t.sel) == 0 } func (t *Target) Selection() []interface{} { return t.sel } -- cgit v1.2.3