diff --git a/src/modes/world.cpp b/src/modes/world.cpp index 31a9a4715..969a4577b 100644 --- a/src/modes/world.cpp +++ b/src/modes/world.cpp @@ -994,6 +994,11 @@ void World::updateGraphics(float dt) Camera::getCamera(i)->update(dt); PROFILER_POP_CPU_MARKER(); + Scripting::ScriptEngine *script_engine = + Scripting::ScriptEngine::getInstance(); + if (script_engine) + script_engine->update(dt); + projectile_manager->updateGraphics(dt); Track::getCurrentTrack()->updateGraphics(dt); } // updateGraphics @@ -1044,14 +1049,6 @@ void World::update(int ticks) PROFILER_POP_CPU_MARKER(); if(race_manager->isRecordingRace()) ReplayRecorder::get()->update(ticks); - if (!RewindManager::get()->isRewinding()) - { - Scripting::ScriptEngine *script_engine = - Scripting::ScriptEngine::getInstance(); - if (script_engine) - script_engine->update(ticks); - } - Physics::getInstance()->update(ticks); PROFILER_PUSH_CPU_MARKER("World::update (projectiles)", 0xa0, 0x7F, 0x00); diff --git a/src/scriptengine/script_engine.cpp b/src/scriptengine/script_engine.cpp index 46a5c5def..72236ea05 100644 --- a/src/scriptengine/script_engine.cpp +++ b/src/scriptengine/script_engine.cpp @@ -563,9 +563,8 @@ namespace Scripting //----------------------------------------------------------------------------- - void ScriptEngine::update(int ticks) + void ScriptEngine::update(float dt) { - double dt = stk_config->ticks2Time(ticks); for (int i = m_pending_timeouts.size() - 1; i >= 0; i--) { PendingTimeout& curr = m_pending_timeouts[i]; diff --git a/src/scriptengine/script_engine.hpp b/src/scriptengine/script_engine.hpp index 063bb43a3..87908977e 100644 --- a/src/scriptengine/script_engine.hpp +++ b/src/scriptengine/script_engine.hpp @@ -82,7 +82,7 @@ namespace Scripting void addPendingTimeout(double time, const std::string& callback_name); void addPendingTimeout(double time, asIScriptFunction* delegate_fn); - void update(int ticks); + void update(float dt); asIScriptEngine* getEngine() { return m_engine; }