diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2025-07-24 17:35:20 -0400 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-08-20 15:57:31 +0200 |
| commit | ed7b03e6318fc0ea7254218631bfdf17ee7146a5 (patch) | |
| tree | 397580ed3384a181df03fa301ae5766a3e1d18c6 | |
| parent | 146ef8462ac8f5f7424e1db4d779ea286aaf6822 (diff) | |
| download | muhqs-game-ed7b03e6318fc0ea7254218631bfdf17ee7146a5.tar.gz muhqs-game-ed7b03e6318fc0ea7254218631bfdf17ee7146a5.zip | |
reset an action's targets after resolving it
| -rw-r--r-- | go/game/stack.go | 2 | ||||
| -rw-r--r-- | go/game/state.go | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/go/game/stack.go b/go/game/stack.go index 62783bf2..1ab4ccf8 100644 --- a/go/game/stack.go +++ b/go/game/stack.go @@ -32,7 +32,7 @@ func (s *Stack) pop() { err := s.gameState.ValidateAction(a) if err == nil { - a.resolve(s.gameState) + s.gameState.ResolveAction(a) } log.Println("Resolved", a, err) diff --git a/go/game/state.go b/go/game/state.go index abad79a7..d16bd51d 100644 --- a/go/game/state.go +++ b/go/game/state.go @@ -885,6 +885,8 @@ func (s *LocalState) endOfTurn() []*Player { // ResolveAction resolves an action without using the stack. func (s *LocalState) ResolveAction(a Action) { a.resolve(s) + // Clear selections to make the acrion reusable + a.Targets().ClearSelections() } func (s *LocalState) SetPhase(p PhaseType) { |
