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.
This commit is contained in:
hiker 2017-12-19 11:14:33 +11:00
parent 4d02e736f7
commit 9addcc4a55

View File

@ -265,8 +265,12 @@ void RewindQueue::mergeNetworkData(float world_time, float dt,
AllNetworkRewindInfo::iterator i = m_network_events.getData().begin(); AllNetworkRewindInfo::iterator i = m_network_events.getData().begin();
while( i!=m_network_events.getData().end() ) while( i!=m_network_events.getData().end() )
{ {
// Ignore any events that will happen in the future. // Ignore any events that will happen in the future. An event needs
if ((*i)->getTime() > world_time+dt) // 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++; i++;
continue; continue;