diff --git a/src/client/game/scripting/lua/scheduler.cpp b/src/client/game/scripting/lua/scheduler.cpp index bceac3a3..256f98a2 100644 --- a/src/client/game/scripting/lua/scheduler.cpp +++ b/src/client/game/scripting/lua/scheduler.cpp @@ -51,7 +51,7 @@ namespace scripting::lua for (auto i = tasks.begin(); i != tasks.end();) { - const auto now = std::chrono::high_resolution_clock::now(); + const auto now = *game::gameTime; const auto diff = now - i->last_call; if (diff < i->delay) @@ -105,8 +105,8 @@ namespace scripting::lua task task; task.is_volatile = is_volatile; task.callback = callback; - task.delay = delay; - task.last_call = std::chrono::steady_clock::now(); + task.delay = static_cast(delay.count()); + task.last_call = *game::gameTime; task.id = id; task.is_deleted = false; diff --git a/src/client/game/scripting/lua/scheduler.hpp b/src/client/game/scripting/lua/scheduler.hpp index c2eb2df9..891efaec 100644 --- a/src/client/game/scripting/lua/scheduler.hpp +++ b/src/client/game/scripting/lua/scheduler.hpp @@ -14,9 +14,9 @@ namespace scripting::lua class task final : public task_handle { public: - std::chrono::steady_clock::time_point last_call{}; + int last_call{}; sol::protected_function callback{}; - std::chrono::milliseconds delay{}; + int delay{}; bool is_volatile = false; bool is_deleted = false; std::vector> endon_conditions{}; diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 426db63d..15af7244 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -196,6 +196,8 @@ namespace game WEAK symbol scr_VmPub{0x14BA9EE40}; WEAK symbol scr_function_stack{0x14BAA93C0}; + WEAK symbol gameTime{0x1455CC780}; + WEAK symbol g_fileSystem{0x1420B27E8}; WEAK symbol maps{0x14097EE90};