From 60c279ce489ff9586bd60eb4ed12727ae77ea3f5 Mon Sep 17 00:00:00 2001 From: Yimura Date: Fri, 21 Jan 2022 23:32:57 +0100 Subject: [PATCH] fix(NativeHooks): Hook on inject --- BigBaseV2/src/native_hooks/native_hooks.hpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/BigBaseV2/src/native_hooks/native_hooks.hpp b/BigBaseV2/src/native_hooks/native_hooks.hpp index 1fd15017..2c89b540 100644 --- a/BigBaseV2/src/native_hooks/native_hooks.hpp +++ b/BigBaseV2/src/native_hooks/native_hooks.hpp @@ -1,4 +1,5 @@ #pragma once +#include "gta_util.hpp" #include "gta/joaat.hpp" #include "gta/script_thread.hpp" #include "native_hooks/carmod_shop.hpp" @@ -25,6 +26,10 @@ namespace big this->add_native_detour(RAGE_JOAAT("carmod_shop"), 0x8E2530AA8ADA980E, carmod_shop::SET_ENTITY_HEADING); this->add_native_detour(RAGE_JOAAT("freemode"), 0x580CE4438479CC61, freemode::NETWORK_CAN_BAIL); + for (auto native_detours_for_script : m_native_registrations) + if (GtaThread* thread = gta_util::find_script_thread(native_detours_for_script.first); thread != nullptr && thread->m_context.m_state == rage::eThreadState::running) + this->check_for_thread(thread); + g_native_hooks = this; } ~native_hooks()