Skip to content

Commit 8050f23

Browse files
committed
fix: Switch kickoff team when switching colors
1 parent f5b329b commit 8050f23

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

internal/app/statemachine/change_switchcolors.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,13 @@ func (s *StateMachine) processChangeSwitchColors(newState *state.State) (changes
99

1010
// 'FirstKickoffTeam' is bound to the team, not the color, so we have to also switch this
1111
*newState.FirstKickoffTeam = newState.FirstKickoffTeam.Opposite()
12+
13+
// 'NextCommand' and 'Command' are bound to the team, not the color, so we have to also switch these
14+
if newState.NextCommand != nil && newState.NextCommand.ForTeam != nil {
15+
*newState.NextCommand.ForTeam = newState.NextCommand.ForTeam.Opposite()
16+
}
17+
if newState.Command != nil && newState.Command.ForTeam != nil {
18+
*newState.Command.ForTeam = newState.Command.ForTeam.Opposite()
19+
}
1220
return
1321
}

0 commit comments

Comments
 (0)