From 0937b2eccf50da96483a846c3f4219ebb131af8e Mon Sep 17 00:00:00 2001 From: Nicolai Ommer Date: Thu, 18 Jul 2024 15:54:56 +0200 Subject: [PATCH] Fix multiple_card game event being ignored --- internal/app/statemachine/change_cards.go | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/internal/app/statemachine/change_cards.go b/internal/app/statemachine/change_cards.go index 40f63b98..f0e432ba 100644 --- a/internal/app/statemachine/change_cards.go +++ b/internal/app/statemachine/change_cards.go @@ -47,19 +47,14 @@ func activeYellowCards(cards []*state.YellowCard) (count int32) { // multipleYellowCardsChange creates a multiple cards event change func (s *StateMachine) multipleYellowCardsChange(byTeam state.Team) *Change { - eventType := state.GameEvent_MULTIPLE_CARDS - return &Change{ - Change: &Change_AddGameEventChange{ - AddGameEventChange: &Change_AddGameEvent{ - GameEvent: &state.GameEvent{ - Type: &eventType, - Event: &state.GameEvent_MultipleCards_{ - MultipleCards: &state.GameEvent_MultipleCards{ - ByTeam: &byTeam, - }, - }, + return createGameEventChange( + state.GameEvent_MULTIPLE_CARDS, + &state.GameEvent{ + Event: &state.GameEvent_MultipleCards_{ + MultipleCards: &state.GameEvent_MultipleCards{ + ByTeam: &byTeam, }, }, }, - } + ) }