Skip to content

Commit

Permalink
[feature] Add a hint to the game event table when Halt sent
Browse files Browse the repository at this point in the history
  • Loading branch information
g3force committed Mar 30, 2019
1 parent 1df758d commit 5c27b42
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/app/controller/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,15 +221,16 @@ func (e *Engine) Continue() {
Type: GameEventBotSubstitution,
Details: GameEventDetails{
BotSubstitution: &refproto.GameEvent_BotSubstitution{ByTeam: &teamProto}}})
e.LogHint("botSubstitution", "game halted for bot substitution", substitutionIntend)
e.SendCommand(CommandHalt, "")
} else if e.State.NextCommand != CommandUnknown {
e.SendCommand(e.State.NextCommand, e.State.NextCommandFor)
} else {
log.Println("No next command available to continue with. Halting game.")
if e.State.Command != CommandStop {
// halt the game, if not in STOP.
// Rational: After ball placement and no next command, halt the game to indicate that manual action is required
// If in STOP, that was most likely triggered manually already and a suddenly halted game might be confusing and not intended
e.LogHint("missingFollowUp", "No next command available", TeamUnknown)
e.SendCommand(CommandHalt, "")
}
}
Expand Down

0 comments on commit 5c27b42

Please sign in to comment.