File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -182,6 +182,7 @@ func (e GameEvent) IsSecondary() bool {
182
182
GameEventUnsportingBehaviorMinor ,
183
183
GameEventUnsportingBehaviorMajor ,
184
184
GameEventMultipleFouls ,
185
+ GameEventMultiplePlacementFailures ,
185
186
GameEventBotCrashUniqueSkipped ,
186
187
GameEventBotPushedBotSkipped ,
187
188
GameEventPlacementFailedByTeamInFavor ,
Original file line number Diff line number Diff line change 6
6
"math"
7
7
)
8
8
9
- // BallPlacementPos determines the ball placement position based on the game event
9
+ // BallPlacementPos determines the ball placement position based on the primary game event
10
10
func (e * Engine ) BallPlacementPos () * Location {
11
11
event := e .State .PrimaryGameEvent ()
12
12
if event == nil {
Original file line number Diff line number Diff line change @@ -394,13 +394,16 @@ func (s State) BotSubstitutionIntend() Team {
394
394
return TeamUnknown
395
395
}
396
396
397
- func (s State ) PrimaryGameEvent () * GameEvent {
397
+ func (s State ) PrimaryGameEvent () (e * GameEvent ) {
398
+ e = nil
398
399
for i := len (s .GameEvents ) - 1 ; i >= 0 ; i -- {
399
- if ! s .GameEvents [i ].IsSecondary () {
400
- return s .GameEvents [i ]
400
+ e = s .GameEvents [i ]
401
+ if e .Type == GameEventMultipleCards {
402
+ // only this event causes a penalty kick and must be prioritized.
403
+ return
401
404
}
402
405
}
403
- return nil
406
+ return
404
407
}
405
408
406
409
func newTeamInfo () (t TeamInfo ) {
You can’t perform that action at this time.
0 commit comments