From bbb777eecc9b08b0049df715f73a5b150fcc1aad Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Mon, 16 Jul 2018 03:02:55 +0900 Subject: [PATCH] internal/clock: Use constant time to detect if the game is delayed too much --- internal/clock/clock.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/clock/clock.go b/internal/clock/clock.go index 52f9592c1..742c77c8c 100644 --- a/internal/clock/clock.go +++ b/internal/clock/clock.go @@ -90,7 +90,7 @@ func Update(logicFPS int) int { count := 0 syncWithSystemClock := false - if diff > 5*int64(time.Second)/int64(logicFPS) { + if diff > int64(time.Second)*5/60 { // The previous time is too old. // Let's force to sync the game time with the system clock. syncWithSystemClock = true