Skip to content

Commit ae11bb6

Browse files
committed
Bugfix: Count ball placement time
1 parent c618747 commit ae11bb6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/app/engine/process_tick.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ func (e *Engine) processTick() {
1919
if e.countStageTime() {
2020
addDur(e.currentState.StageTimeElapsed, delta)
2121
addDur(e.currentState.StageTimeLeft, -delta)
22+
}
2223

24+
if e.countCurrentActionTime() {
2325
addDur(e.currentState.CurrentActionTimeRemaining, -delta)
2426
minimumTimeRemaining := -time.Minute * 30
2527
if goDur(e.currentState.CurrentActionTimeRemaining) < minimumTimeRemaining {
@@ -56,6 +58,10 @@ func (e *Engine) countStageTime() bool {
5658
return e.currentState.Stage.IsPausedStage() || e.currentState.Command.IsRunning()
5759
}
5860

61+
func (e *Engine) countCurrentActionTime() bool {
62+
return e.countStageTime() || *e.currentState.Command.Type == state.Command_BALL_PLACEMENT
63+
}
64+
5965
func (e *Engine) countCardTime() bool {
6066
return e.currentState.Command.IsRunning()
6167
}

0 commit comments

Comments
 (0)