From f242120cd1e41d0cd3ff3c28cc782245d86bc81d Mon Sep 17 00:00:00 2001 From: hiker Date: Tue, 9 Jan 2018 07:56:10 +1100 Subject: [PATCH] Fixed difference from one replay to the next (caused by returning the actual measured DT in certain cases instead of the recorded one). --- src/race/history.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/race/history.cpp b/src/race/history.cpp index e8b316a43..6d4c3701e 100644 --- a/src/race/history.cpp +++ b/src/race/history.cpp @@ -53,9 +53,10 @@ void History::initRecording() / stk_config->m_replay_dt ); allocateMemory(max_frames); m_current = -1; - m_event_index = 0; m_wrapped = false; m_size = 0; + m_event_index = 0; + m_all_input_events.clear(); } // initRecording //----------------------------------------------------------------------------- @@ -128,7 +129,9 @@ void History::updateSaving(float dt) */ float History::updateReplayAndGetDT(float world_time, float dt) { - if (m_history_time >= world_time) return dt; + if (m_history_time > world_time && NetworkConfig::get()->isNetworking()) + return dt; + World *world = World::getWorld(); // In non-networked history races, we need to do at least one timestep