internal/clock: Use constant time to detect if the game is delayed too much

This commit is contained in:
Hajime Hoshi 2018-07-16 03:02:55 +09:00
parent 18ec1d8265
commit bbb777eecc

View File

@ -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