From 842bb3617adae35d9f06db445e731bddc865c743 Mon Sep 17 00:00:00 2001 From: Yimura Date: Sat, 8 Jan 2022 01:43:04 +0100 Subject: [PATCH] refactor: Move find_script_thread to gta_util --- BigBaseV2/src/gta_util.hpp | 16 ++++++++++++++++ BigBaseV2/src/hooking.cpp | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/BigBaseV2/src/gta_util.hpp b/BigBaseV2/src/gta_util.hpp index 71bb5221..2ed065a7 100644 --- a/BigBaseV2/src/gta_util.hpp +++ b/BigBaseV2/src/gta_util.hpp @@ -54,4 +54,20 @@ namespace big::gta_util return; } } + + inline GtaThread* find_script_thread(rage::joaat_t hash) + { + for (auto thread : *g_pointers->m_script_threads) + { + if (thread + && thread->m_context.m_thread_id + && thread->m_handler + && thread->m_script_hash == hash) + { + return thread; + } + } + + return nullptr; + } } diff --git a/BigBaseV2/src/hooking.cpp b/BigBaseV2/src/hooking.cpp index 55bd5198..ebea5e6f 100644 --- a/BigBaseV2/src/hooking.cpp +++ b/BigBaseV2/src/hooking.cpp @@ -17,22 +17,6 @@ namespace big { - static GtaThread *find_script_thread(rage::joaat_t hash) - { - for (auto thread : *g_pointers->m_script_threads) - { - if (thread - && thread->m_context.m_thread_id - && thread->m_handler - && thread->m_script_hash == hash) - { - return thread; - } - } - - return nullptr; - } - hooking::hooking() : m_swapchain_hook(*g_pointers->m_swapchain, hooks::swapchain_num_funcs), // SetCursorPos