aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--go/game/state.go9
1 files 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) {