Skip to content

Commit 47acf1a

Browse files
committed
Fix: Do not set placement pos to corner kick, if next command is kickoff
1 parent f75954a commit 47acf1a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/app/statemachine/placementPos.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ func (s *BallPlacementPosDeterminer) Location() *geom.Vector2 {
114114
state.GameEvent_UNSPORTING_BEHAVIOR_MAJOR:
115115
return s.keepCurrentPlacementPos()
116116
case state.GameEvent_EXCESSIVE_BOT_SUBSTITUTION:
117+
if s.State.NextCommand != nil && *s.State.NextCommand.Type != state.Command_DIRECT {
118+
// if next command is not a free kick, keep current placement pos.
119+
// next command is not changed if it was free kick or penalty kick.
120+
return s.keepCurrentPlacementPos()
121+
}
117122
if s.State.HasGameEventByTeam(state.GameEvent_EXCESSIVE_BOT_SUBSTITUTION, s.Event.ByTeam().Opposite()) {
118123
// both teams have excessive bot substitution. Recover original placement pos
119124
// As we do not know the original placement pos, we have to iterate over all game events

0 commit comments

Comments
 (0)