Skip to content

Commit 0cbd777

Browse files
committed
[bugfix] Do not reset ball placement position on ball interference
1 parent 8c93a73 commit 0cbd777

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

internal/app/controller/placementPos.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ func (e *Engine) BallPlacementPos() *Location {
1212
if event == nil {
1313
return nil
1414
}
15-
if event.IsSecondary() || event.IsSkipped() {
16-
return nil
17-
}
1815

1916
switch event.Type {
2017
case GameEventBallLeftFieldTouchLine:
@@ -53,20 +50,14 @@ func (e *Engine) BallPlacementPos() *Location {
5350
return e.validateProtoLocation(event.Details.BotTippedOver.Location)
5451
case GameEventBotInterferedPlacement:
5552
return e.validateLocation(e.State.PlacementPos)
56-
case GameEventBotCrashDrawn:
57-
return e.validateProtoLocation(event.Details.BotCrashDrawn.Location)
5853
case GameEventBotKickedBallTooFast:
5954
return e.validateProtoLocation(event.Details.BotKickedBallTooFast.Location)
6055
case GameEventBotDribbledBallTooFar:
6156
return e.validateProtoLocation(event.Details.BotDribbledBallTooFar.Start)
6257
case GameEventBotCrashUnique:
6358
return e.validateProtoLocation(event.Details.BotCrashUnique.Location)
64-
case GameEventBotCrashUniqueSkipped:
65-
return e.validateProtoLocation(event.Details.BotCrashUniqueSkipped.Location)
6659
case GameEventBotPushedBot:
6760
return e.validateProtoLocation(event.Details.BotPushedBot.Location)
68-
case GameEventBotPushedBotSkipped:
69-
return e.validateProtoLocation(event.Details.BotPushedBotSkipped.Location)
7061
case GameEventBotHeldBallDeliberately:
7162
return e.validateProtoLocation(event.Details.BotHeldBallDeliberately.Location)
7263
case GameEventAttackerDoubleTouchedBall:
@@ -97,6 +88,20 @@ func (e *Engine) BallPlacementPos() *Location {
9788
return e.validateProtoLocation(event.Details.NoProgressInGame.Location)
9889
case GameEventPlacementFailed:
9990
return e.validateLocation(e.State.PlacementPos)
91+
case GameEventBotTooFastInStop,
92+
GameEventBotCrashDrawn,
93+
GameEventUnsportingBehaviorMinor,
94+
GameEventUnsportingBehaviorMajor,
95+
GameEventMultipleFouls,
96+
GameEventMultiplePlacementFailures,
97+
GameEventBotCrashUniqueSkipped,
98+
GameEventBotPushedBotSkipped,
99+
GameEventAttackerTouchedOpponentInDefenseAreaSkipped,
100+
GameEventPlacementSucceeded,
101+
GameEventPrepared,
102+
GameEventBotSubstitution,
103+
GameEventTooManyRobots:
104+
return nil
100105
default:
101106
log.Print("Warn: Unknown game event: ", event.Type)
102107
return nil

0 commit comments

Comments
 (0)