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 {
540
540
}
541
541
542
542
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 ())
545
550
} else if e .State .GameState () != GameStateStopped {
546
551
e .SendCommand (CommandStop , "" )
547
552
}
You can’t perform that action at this time.
0 commit comments