From 9e0b16c9f654a2bf8804509c4fd2887a392f71d5 Mon Sep 17 00:00:00 2001 From: Nicolai Ommer Date: Sat, 23 Apr 2022 09:42:49 +0200 Subject: [PATCH] Fix: Consider removal time for yellow cards only during RUNNING --- internal/app/engine/process_botremoved.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/app/engine/process_botremoved.go b/internal/app/engine/process_botremoved.go index 654074a5..9508a801 100644 --- a/internal/app/engine/process_botremoved.go +++ b/internal/app/engine/process_botremoved.go @@ -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)