Skip to content

Commit 1bacac1

Browse files
author
Mikel
committed
fix: MT server/client sync affecting server's internal time (dtime)
1 parent caefe05 commit 1bacac1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/server.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,9 @@ void *ServerThread::run()
125125
while (!stopRequested()) {
126126
ScopeProfiler spm(g_profiler, "Server::RunStep() (max)", SPT_MAX);
127127

128+
// Sync before computing t0, such that it does not affect the internal time (dtime)
129+
syncServerStep();
130+
128131
u64 t0 = porting::getTimeUs();
129132

130133
const Server::StepSettings step_settings = m_server->getStepSettings();
@@ -614,8 +617,6 @@ void Server::step()
614617

615618
void Server::AsyncRunStep(float dtime, bool initial_step)
616619
{
617-
syncServerStep();
618-
619620
{
620621
// Send blocks to clients
621622
SendBlocks(dtime);

0 commit comments

Comments
 (0)