fix(NativeHooks): Hook on inject

This commit is contained in:
Yimura 2022-01-21 23:32:57 +01:00
parent 1273b47ef2
commit 60c279ce48

View File

@ -1,4 +1,5 @@
#pragma once #pragma once
#include "gta_util.hpp"
#include "gta/joaat.hpp" #include "gta/joaat.hpp"
#include "gta/script_thread.hpp" #include "gta/script_thread.hpp"
#include "native_hooks/carmod_shop.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("carmod_shop"), 0x8E2530AA8ADA980E, carmod_shop::SET_ENTITY_HEADING);
this->add_native_detour(RAGE_JOAAT("freemode"), 0x580CE4438479CC61, freemode::NETWORK_CAN_BAIL); 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; g_native_hooks = this;
} }
~native_hooks() ~native_hooks()