From 71beb8bac4e022eb511b597fab4c333e0c46c896 Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Wed, 2 Feb 2022 23:35:34 +0100 Subject: [PATCH] Use sys_ismainthread --- src/client/component/ui_scripting.cpp | 3 +-- src/client/game/symbols.hpp | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index 96aeb3df..aee1a555 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -200,8 +200,7 @@ namespace ui_scripting { scheduler::loop([]() { - const auto self_id = GetCurrentThreadId(); - if (self_id == game::threadIds[game::THREAD_CONTEXT_MAIN]) + if (game::Sys_IsMainThread()) { ui_scripting::lua::engine::run_frame(); } diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 1a37c132..f9108c0a 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -131,6 +131,7 @@ namespace game WEAK symbol Sys_ShowConsole{0x633080}; WEAK symbol Sys_IsDatabaseReady2{0x5A9FE0}; WEAK symbol Sys_Milliseconds{0x650720}; + WEAK symbol Sys_IsMainThread{0x5AA020}; WEAK symbol UI_SafeTranslateString{0x5A2930}; WEAK symbol UI_PlayLocalSoundAlias{0x606080};