File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -506,10 +506,6 @@ func (e *Engine) processGameEvent(event *GameEvent) error {
506506 return errors .Errorf ("Incomplete game event: %v" , event )
507507 }
508508
509- if e .State .GameState () != GameStateStopped && e .State .GameState () != GameStateHalted && ! event .IsContinued () {
510- e .SendCommand (CommandStop , "" )
511- }
512-
513509 if event .IncrementsFoulCounter () {
514510 team := event .ByTeam ()
515511 if team .Unknown () {
@@ -540,6 +536,15 @@ func (e *Engine) processGameEvent(event *GameEvent) error {
540536 e .SendGameEventSecondary (* event )
541537 } else {
542538 e .SendGameEventPrimary (* event )
539+ e .State .PlacementPos = e .BallPlacementPos ()
540+ }
541+
542+ if e .State .GameState () != GameStateHalted && ! event .IsContinued () {
543+ if e .State .PlacementPos != nil {
544+ e .SendCommand (CommandBallPlacement , e .State .GameEvent .ByTeam ().Opposite ())
545+ } else if e .State .GameState () != GameStateStopped {
546+ e .SendCommand (CommandStop , "" )
547+ }
543548 }
544549
545550 log .Printf ("Processed game event %v" , event )
You can’t perform that action at this time.
0 commit comments