Skip to content

Commit 2e78856

Browse files
committed
Set placementPos when switching stages
1 parent 84f0c9b commit 2e78856

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

internal/app/statemachine/change_stage.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package statemachine
22

33
import (
4+
"github.com/RoboCup-SSL/ssl-game-controller/internal/app/geom"
45
"github.com/RoboCup-SSL/ssl-game-controller/internal/app/state"
56
"github.com/golang/protobuf/ptypes"
67
"time"
@@ -41,6 +42,13 @@ func (s *StateMachine) processChangeChangeStage(newState *state.State, change *C
4142
// update next command based on new stage
4243
newState.NextCommand = s.getNextCommandForStage(newState, *change.NewStage)
4344

45+
// update placement pos (assuming it is either kickoff or nothing)
46+
if newState.NextCommand == nil {
47+
newState.PlacementPos = nil
48+
} else {
49+
newState.PlacementPos = geom.NewVector2(0.0, 0.0)
50+
}
51+
4452
// update new stage
4553
newState.Stage = change.NewStage
4654

0 commit comments

Comments
 (0)