Skip to content

Commit 659081b

Browse files
committed
[feature] Reset game events on penalty and kickoff commands, too
1 parent 2408af6 commit 659081b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

internal/app/controller/engine.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func (e *Engine) SendCommand(command RefCommand, forTeam Team) {
5555
e.State.CommandFor = forTeam
5656
e.LogCommand()
5757

58-
if command.RunningState() && len(e.State.GameEvents) > 0 {
58+
if command.ContinuesGame() && len(e.State.GameEvents) > 0 {
5959
e.State.GameEvents = []*GameEvent{}
6060
}
6161
}

internal/app/controller/state.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,14 @@ const (
193193
CommandBallPlacement RefCommand = "ballPlacement"
194194
)
195195

196-
func (c RefCommand) RunningState() bool {
196+
func (c RefCommand) ContinuesGame() bool {
197197
switch c {
198-
case CommandNormalStart, CommandForceStart, CommandDirect, CommandIndirect:
198+
case CommandNormalStart,
199+
CommandForceStart,
200+
CommandDirect,
201+
CommandIndirect,
202+
CommandPenalty,
203+
CommandKickoff:
199204
return true
200205
default:
201206
return false

0 commit comments

Comments
 (0)