Use sys_ismainthread

This commit is contained in:
Federico Cecchetto 2022-02-02 23:35:34 +01:00
parent 2470553e1e
commit 71beb8bac4
2 changed files with 2 additions and 2 deletions

View File

@ -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();
}

View File

@ -131,6 +131,7 @@ namespace game
WEAK symbol<void()> Sys_ShowConsole{0x633080};
WEAK symbol<bool()> Sys_IsDatabaseReady2{0x5A9FE0};
WEAK symbol<int()> Sys_Milliseconds{0x650720};
WEAK symbol<bool()> Sys_IsMainThread{0x5AA020};
WEAK symbol<const char*(const char* string)> UI_SafeTranslateString{0x5A2930};
WEAK symbol<int(int localClientNum, const char* sound)> UI_PlayLocalSoundAlias{0x606080};