Skip to content

Commit 42b3b5c

Browse files
committed
Fix: Keep nextCommand for kickoff as well
1 parent ac9d5d5 commit 42b3b5c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

internal/app/statemachine/change_gameevent.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,10 +316,12 @@ func (s *StateMachine) multipleFoulsChange(byTeam state.Team, events []*state.Ga
316316

317317
// nextCommandForEvent determines the next command for the given event or returns the currently set one
318318
func (s *StateMachine) nextCommandForEvent(newState *state.State, gameEvent *state.GameEvent) (command *state.Command) {
319-
if newState.NextCommand != nil && *newState.NextCommand.Type == state.Command_PENALTY {
320-
// keep current next command, if it is a penalty kick
319+
if newState.NextCommand != nil &&
320+
(*newState.NextCommand.Type == state.Command_PENALTY ||
321+
*newState.NextCommand.Type == state.Command_KICKOFF) {
322+
// keep current next command, if it is a penalty kick or kickoff
321323
// some game events, like GameEvent_ATTACKER_TOO_CLOSE_TO_DEFENSE_AREA, can also happen during STOP,
322-
// and thus after a game event that resulted in a penalty kick.
324+
// and thus after a game event that resulted in a penalty kick or kickoff.
323325
return newState.NextCommand
324326
}
325327
switch *gameEvent.Type {

0 commit comments

Comments
 (0)