Skip to content

Commit

Permalink
Fix: Consider removal time for yellow cards only during RUNNING
Browse files Browse the repository at this point in the history
  • Loading branch information
g3force committed Apr 23, 2022
1 parent 7d4b60c commit 9e0b16c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/app/engine/process_botremoved.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,13 @@ func (p *BotNumberProcessor) processBotNumber() {
func (e *Engine) processBotNumberPerTeam(team state.Team) {

teamInfo := e.currentState.TeamState[team.String()]
removalTime := e.gameConfig.YellowCardBotRemovalTime
if *e.currentState.GameState.Type != state.GameState_RUNNING {
removalTime = 0
}
newCards := newActiveYellowCards(
teamInfo.YellowCards,
e.gameConfig.YellowCardDuration-e.gameConfig.YellowCardBotRemovalTime,
e.gameConfig.YellowCardDuration-removalTime,
)

numBots := e.gcState.TrackerStateGc.NumTeamRobots(team)
Expand Down

0 comments on commit 9e0b16c

Please sign in to comment.