Skip to content

Commit 4082cfd

Browse files
committed
[#150] Set ball placement pos correctly during shootout phase
1 parent dbf9e70 commit 4082cfd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: internal/app/statemachine/placementPos.go

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ type BallPlacementPosDeterminer struct {
1818

1919
// Location determines the ball placement position based on the game event type
2020
func (s *BallPlacementPosDeterminer) Location() *geom.Vector2 {
21+
if *s.State.Stage == state.Referee_PENALTY_SHOOTOUT &&
22+
s.State.NextCommand != nil && s.State.NextCommand.ForTeam.Known() {
23+
teamInFavor := *s.State.NextCommand.ForTeam
24+
return s.penaltyKick(teamInFavor)
25+
}
26+
2127
switch *s.Event.Type {
2228
// Ball out of field events (stopping)
2329
case state.GameEvent_BALL_LEFT_FIELD_TOUCH_LINE:

0 commit comments

Comments
 (0)