aboutsummaryrefslogtreecommitdiff
path: root/go/game
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2023-02-26 10:58:48 +0100
committerFlorian Fischer <florian.fischer@muhq.space>2025-08-20 15:57:07 +0200
commit1e69eda943c68ef8271dc422557badcde8a27909 (patch)
tree6dfbeee676cff89950f94af98f0899cb8f0c0a03 /go/game
parenta1ab548f016f07171224d59cbaae37c35a47a24a (diff)
downloadmuhqs-game-1e69eda943c68ef8271dc422557badcde8a27909.tar.gz
muhqs-game-1e69eda943c68ef8271dc422557badcde8a27909.zip
reset an action's targets after broadcasting its resolution
Diffstat (limited to 'go/game')
-rw-r--r--go/game/stack.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/go/game/stack.go b/go/game/stack.go
index 60f041b3..5d71eae3 100644
--- a/go/game/stack.go
+++ b/go/game/stack.go
@@ -33,14 +33,16 @@ func (s *Stack) pop() {
err := s.gameState.ValidateAction(a)
if err == nil {
a.resolve(s.gameState)
- // Some action may be reused like full actions of permanents.
- // Reset their target selection to allow possible reuse.
- if t := a.Targets(); t != nil {
- t.ClearSelections()
- }
}
+
log.Println("Resolved", a, err)
s.gameState.broadcastNotification(newResolvedActionNotification(a, err))
+
+ // Some action may be reused like full actions of permanents.
+ // Reset their target selection to allow possible reuse.
+ if t := a.Targets(); err == nil && t != nil {
+ t.ClearSelections()
+ }
}
func (s *Stack) resolve() {