From 2470553e1e1bbf72c5f364de9f4407bbe6f4163f Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Wed, 2 Feb 2022 21:31:22 +0100 Subject: [PATCH] Fix a weird LUI/UI scripting related crash --- src/client/component/ui_scripting.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/client/component/ui_scripting.cpp b/src/client/component/ui_scripting.cpp index ba8bfbe3..96aeb3df 100644 --- a/src/client/component/ui_scripting.cpp +++ b/src/client/component/ui_scripting.cpp @@ -200,7 +200,12 @@ namespace ui_scripting { scheduler::loop([]() { - ui_scripting::lua::engine::run_frame(); + const auto self_id = GetCurrentThreadId(); + if (self_id == game::threadIds[game::THREAD_CONTEXT_MAIN]) + { + ui_scripting::lua::engine::run_frame(); + } + fps::draw(); branding::draw(); game_console::draw_console();