From 9addcc4a559b0e36e067078884f3a9492aada9b1 Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 19 Dec 2017 11:14:33 +1100 Subject: [PATCH] Fixed handling of steering etc events: they are now properly done at the closest time stamp, previously they were typically exectuted too early on the server. --- src/network/rewind_queue.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/network/rewind_queue.cpp b/src/network/rewind_queue.cpp index d76299714..a9d80b340 100755 --- a/src/network/rewind_queue.cpp +++ b/src/network/rewind_queue.cpp @@ -265,8 +265,12 @@ void RewindQueue::mergeNetworkData(float world_time, float dt, AllNetworkRewindInfo::iterator i = m_network_events.getData().begin(); while( i!=m_network_events.getData().end() ) { - // Ignore any events that will happen in the future. - if ((*i)->getTime() > world_time+dt) + // Ignore any events that will happen in the future. An event needs + // to be handled at the closest time to its original time. The current + // time step id world_time, the next will be world_time+dt. So if the + // event is later than world_time+0.5*dt, it will be closer to a + // future time stamp and is ignored now. + if ((*i)->getTime() > world_time+0.5f*dt) { i++; continue;