aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/game/targets.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/go/game/targets.go b/go/game/targets.go
index 05d690c0..2eba87eb 100644
--- a/go/game/targets.go
+++ b/go/game/targets.go
@@ -213,7 +213,13 @@ func (t *Target) Options() (options []any) {
candidates := t.candidates()
for _, candidate := range candidates {
- if err := t.constraint(candidate); err == nil {
+
+ err := t.constraint(candidate)
+ // TODO: Fix this if a single target allows multiple selections of the same object.
+ if err == nil && slices.Contains(t.sel, candidate) {
+ err = ErrTargetAlreadySelected
+ }
+ if err == nil {
options = append(options, candidate)
} else {
log.Debug("no valid option", "candidate", candidate, "error", err)