diff --git a/data/ui_scripts/scoreboard/__init__.lua b/data/ui_scripts/scoreboard/__init__.lua index fc5f55d..bd6360e 100644 --- a/data/ui_scripts/scoreboard/__init__.lua +++ b/data/ui_scripts/scoreboard/__init__.lua @@ -1,5 +1,7 @@ -function luiglobals.GetPartyMaxPlayers() - return Engine.GetDvarInt("sv_maxclients") -end - -LUI.mp_hud.Scoreboard.maxPlayersOnTeam = luiglobals.GetTeamLimitForMaxPlayers(luiglobals.GetPartyMaxPlayers()) \ No newline at end of file +if (LUI.mp_hud.Scoreboard) then + function luiglobals.GetPartyMaxPlayers() + return Engine.GetDvarInt("sv_maxclients") + end + + LUI.mp_hud.Scoreboard.maxPlayersOnTeam = luiglobals.GetTeamLimitForMaxPlayers(luiglobals.GetPartyMaxPlayers()) +end \ No newline at end of file diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index 6ee253c..a7c1726 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -135,7 +135,13 @@ namespace ui_scripting return; } - scheduler::loop(ui_scripting::lua::engine::run_frame, scheduler::pipeline::renderer); + scheduler::loop([]() + { + if (game::Sys_IsMainThread()) + { + ui_scripting::lua::engine::run_frame(); + } + }, scheduler::pipeline::renderer); hks_start_hook.create(0x1400E4E40, hks_start_stub); hks_shutdown_hook.create(0x1400DB9A0, hks_shutdown_stub); diff --git a/src/client/game/symbols.hpp b/src/client/game/symbols.hpp index 60ebf8f..1503aec 100644 --- a/src/client/game/symbols.hpp +++ b/src/client/game/symbols.hpp @@ -220,6 +220,7 @@ namespace game WEAK symbol Sys_SendPacket{0x14038E720, 0x1404D8460}; WEAK symbol Sys_SetFolder{0x14037BDD0, 0x1404CCA10}; WEAK symbol Sys_ShowConsole{0x14038FA90, 0x1404D98B0}; + WEAK symbol Sys_IsMainThread{0x1402FF9C0, 0x1403E1880}; WEAK symbol UI_GetMapDisplayName{0, 0x1403B1CD0}; WEAK symbol UI_GetGameTypeDisplayName{0, 0x1403B1670};