clock: Bug fix: The game was frozen when TPS is <= 4

Fixes #1417
This commit is contained in:
Hajime Hoshi 2020-12-13 15:14:12 +09:00
parent ede16afd30
commit 547621ddad

View File

@ -73,7 +73,7 @@ func calcCountFromTPS(tps int64, now int64) int {
count := 0
syncWithSystemClock := false
if diff > int64(time.Second)*5/60 {
if diff > int64(time.Second)*5/int64(tps) {
// The previous time is too old.
// Let's force to sync the game time with the system clock.
syncWithSystemClock = true