From f3dce6f8edb37284d46de2c396396d35cd61c137 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 26 Mar 2024 21:31:47 +0100 Subject: check if Targets allow a selection This fixes highlighting when an action needs no targets at all. --- go/game/targets.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'go/game') diff --git a/go/game/targets.go b/go/game/targets.go index fb393057..58f19dc1 100644 --- a/go/game/targets.go +++ b/go/game/targets.go @@ -271,6 +271,16 @@ func (targets *Targets) RequireSelection() bool { return false } +func (targets *Targets) AllowSelection() bool { + for _, t := range targets.ts { + if t.AllowSelection() { + return true + } + } + + return false +} + func conjunction(constraints ...TargetConstraintFunc) TargetConstraintFunc { return func(t interface{}) error { for _, constraint := range constraints { -- cgit v1.2.3