From 6af80e936d10bc506dc10ed79d9d276df29562d9 Mon Sep 17 00:00:00 2001 From: Arthur <121949966+ShinyWasabi@users.noreply.github.com> Date: Mon, 26 Aug 2024 00:16:56 +0300 Subject: [PATCH] Fix Thread State for Script Functions and cellphone_flashhand (#3619) --- src/lua/bindings/scr_function.cpp | 4 ++-- src/script_function.hpp | 2 +- src/services/hotkey/hotkey_service.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lua/bindings/scr_function.cpp b/src/lua/bindings/scr_function.cpp index 2c80a633..69ee4742 100644 --- a/src/lua/bindings/scr_function.cpp +++ b/src/lua/bindings/scr_function.cpp @@ -161,7 +161,7 @@ namespace lua::scr_function stack[ctx.m_stack_pointer++] = 0; ctx.m_instruction_pointer = instruction_pointer; - ctx.m_state = rage::eThreadState::idle; + ctx.m_state = rage::eThreadState::running; big::g_pointers->m_gta.m_script_vm(stack, big::g_pointers->m_gta.m_script_globals, program, &ctx); @@ -313,7 +313,7 @@ namespace lua::scr_function stack[ctx.m_stack_pointer++] = 0; ctx.m_instruction_pointer = instruction_pointer; - ctx.m_state = rage::eThreadState::idle; + ctx.m_state = rage::eThreadState::running; big::g_pointers->m_gta.m_script_vm(stack, big::g_pointers->m_gta.m_script_globals, program, &ctx); diff --git a/src/script_function.hpp b/src/script_function.hpp index 059d172a..d96a8227 100644 --- a/src/script_function.hpp +++ b/src/script_function.hpp @@ -55,7 +55,7 @@ namespace big stack[ctx.m_stack_pointer++] = 0; ctx.m_instruction_pointer = ip; - ctx.m_state = rage::eThreadState::idle; + ctx.m_state = rage::eThreadState::running; g_pointers->m_gta.m_script_vm(stack, g_pointers->m_gta.m_script_globals, program, &ctx); diff --git a/src/services/hotkey/hotkey_service.cpp b/src/services/hotkey/hotkey_service.cpp index 28641eda..fd6960ba 100644 --- a/src/services/hotkey/hotkey_service.cpp +++ b/src/services/hotkey/hotkey_service.cpp @@ -94,7 +94,7 @@ namespace big { if (script && script->m_script_hash == "cellphone_flashhand"_J) { - is_using_cellphone = script->m_context.m_state == rage::eThreadState::running; + is_using_cellphone = script->m_context.m_state == rage::eThreadState::idle; } }