Fix bug
This commit is contained in:
parent
ab94c12299
commit
728a1de2e5
2
main.go
2
main.go
@ -226,6 +226,7 @@ func main() {
|
|||||||
deltaTime := currentTime - prevTime
|
deltaTime := currentTime - prevTime
|
||||||
prevTime = currentTime
|
prevTime = currentTime
|
||||||
worldLock.Lock()
|
worldLock.Lock()
|
||||||
|
playerUpdateMutex.Lock()
|
||||||
|
|
||||||
// Catch up in case of a large delta time
|
// Catch up in case of a large delta time
|
||||||
for deltaTime > maxDeltaTime {
|
for deltaTime > maxDeltaTime {
|
||||||
@ -281,6 +282,7 @@ func main() {
|
|||||||
resetMapProfilingCounters(&totalRenderTime, &totalScalingTime, &totalFrameTime, &frameCount)
|
resetMapProfilingCounters(&totalRenderTime, &totalScalingTime, &totalFrameTime, &frameCount)
|
||||||
}
|
}
|
||||||
worldLock.Unlock()
|
worldLock.Unlock()
|
||||||
|
playerUpdateMutex.Unlock()
|
||||||
enforceFrameRate(currentTime, 60)
|
enforceFrameRate(currentTime, 60)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user