From 6826247879dc5daba9c5ca7adb9e242fedb20349 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Mon, 28 Jul 2025 23:29:24 +0200 Subject: only clear the selections if the target is not nil --- go/game/state.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/go/game/state.go b/go/game/state.go index d16bd51d..dd3cb007 100644 --- a/go/game/state.go +++ b/go/game/state.go @@ -882,11 +882,14 @@ func (s *LocalState) endOfTurn() []*Player { return s.stateBasedActions() } -// ResolveAction resolves an action without using the stack. +// ResolveAction resolves an action. +// Additionally it resets the targets of the action to make it reusable. func (s *LocalState) ResolveAction(a Action) { a.resolve(s) - // Clear selections to make the acrion reusable - a.Targets().ClearSelections() + // Clear selections to make the action reusable + if a.Targets() != nil { + a.Targets().ClearSelections() + } } func (s *LocalState) SetPhase(p PhaseType) { -- cgit v1.2.3