Skip to content

Commit bcbe84f

Browse files
committed
[bugfix] Do not send ball placement command for penalty and kickoff
1 parent e7816b3 commit bcbe84f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/app/controller/engine.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,11 @@ func (e *Engine) placeBall(event *GameEvent) {
775775
return
776776
}
777777

778-
if e.State.Division == config.DivA && // For division A
778+
nextCommand, _, _ := e.CommandForEvent(event)
779+
if nextCommand == CommandPenalty || nextCommand == CommandKickoff {
780+
e.SendCommand(CommandHalt, "")
781+
e.LogHint("manualPlacement", "manual placement required for kickoff and penalty", teamInFavor)
782+
} else if e.State.Division == config.DivA && // For division A
779783
!e.State.TeamState[teamInFavor].CanPlaceBall && // If team in favor can not place the ball
780784
e.State.TeamState[teamInFavor.Opposite()].CanPlaceBall && // If opponent team can place the ball
781785
event.Type.resultsFromBallLeavingField() {

0 commit comments

Comments
 (0)