1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Avoid movement jitter (#13093)

This allows the client and server to agree on the position of objects and attached players even when there is lag.
This commit is contained in:
lhofhansl 2023-12-10 10:12:37 -08:00 committed by GitHub
parent 55fafb7d25
commit a98200bb4c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 7 deletions

View file

@ -577,8 +577,8 @@ void Server::stop()
void Server::step(float dtime)
{
// Limit a bit
if (dtime > 2.0)
dtime = 2.0;
if (dtime > DTIME_LIMIT)
dtime = DTIME_LIMIT;
{
MutexAutoLock lock(m_step_dtime_mutex);
m_step_dtime += dtime;