File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -540,8 +540,13 @@ func (e *Engine) processGameEvent(event *GameEvent) error {
540540 }
541541
542542 if e .State .GameState () != GameStateHalted && ! event .IsContinued () {
543- if e .State .PlacementPos != nil {
544- e .SendCommand (CommandBallPlacement , e .State .GameEvent .ByTeam ().Opposite ())
543+ teamInFavor := e .State .GameEvent .ByTeam ().Opposite ()
544+ if e .State .PlacementPos == nil {
545+ e .SendCommand (CommandStop , "" )
546+ } else if e .State .TeamState [teamInFavor ].CanPlaceBall {
547+ e .SendCommand (CommandBallPlacement , teamInFavor )
548+ } else if e .State .TeamState [teamInFavor .Opposite ()].CanPlaceBall {
549+ e .SendCommand (CommandBallPlacement , teamInFavor .Opposite ())
545550 } else if e .State .GameState () != GameStateStopped {
546551 e .SendCommand (CommandStop , "" )
547552 }
You can’t perform that action at this time.
0 commit comments