From c9d1d1c5799cb8f80bfd793bafc441e1d0fdf890 Mon Sep 17 00:00:00 2001 From: "auria.mg" Date: Sat, 21 Apr 2018 18:46:21 -0400 Subject: [PATCH] Fix issue with ticks vs time elapsed in scripting engine --- src/scriptengine/script_engine.cpp | 3 ++- src/scriptengine/script_engine.hpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/scriptengine/script_engine.cpp b/src/scriptengine/script_engine.cpp index 3a51960ed..c7921f446 100644 --- a/src/scriptengine/script_engine.cpp +++ b/src/scriptengine/script_engine.cpp @@ -562,8 +562,9 @@ namespace Scripting //----------------------------------------------------------------------------- - void ScriptEngine::update(double dt) + void ScriptEngine::update(int ticks) { + 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 f542c8220..063bb43a3 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(double dt); + void update(int ticks); asIScriptEngine* getEngine() { return m_engine; }