Skip to content

Commit 3feed9d

Browse files
committed
Reduce robot count to 2 in shootout
1 parent 6a75fc5 commit 3feed9d

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

internal/simctl/handler_robot_count.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,17 @@ func (r *RobotCountHandler) handleRobotCount() {
5555
}
5656
}
5757

58-
r.updateRobotCount(blueRobots, int(*r.c.lastRefereeMsg.Blue.MaxAllowedBots), referee.Team_BLUE)
59-
r.updateRobotCount(yellowRobots, int(*r.c.lastRefereeMsg.Yellow.MaxAllowedBots), referee.Team_YELLOW)
58+
maxBlueRobots := int(*r.c.lastRefereeMsg.Blue.MaxAllowedBots)
59+
maxYellowRobots := int(*r.c.lastRefereeMsg.Blue.MaxAllowedBots)
60+
61+
switch *r.c.lastRefereeMsg.Stage {
62+
case referee.Referee_PENALTY_SHOOTOUT, referee.Referee_PENALTY_SHOOTOUT_BREAK:
63+
maxBlueRobots = 2
64+
maxYellowRobots = 2
65+
}
66+
67+
r.updateRobotCount(blueRobots, maxBlueRobots, referee.Team_BLUE)
68+
r.updateRobotCount(yellowRobots, maxYellowRobots, referee.Team_YELLOW)
6069
}
6170

6271
func (r *RobotCountHandler) updateRobotCount(robots []*tracker.TrackedRobot, maxRobots int, team referee.Team) {

0 commit comments

Comments
 (0)