2022-01-21 23:13:10 +01:00
|
|
|
#include "hooking.hpp"
|
|
|
|
#include "native_hooks/native_hooks.hpp"
|
|
|
|
|
|
|
|
namespace big
|
|
|
|
{
|
|
|
|
rage::eThreadState hooks::gta_thread_kill(GtaThread* thread)
|
|
|
|
{
|
|
|
|
rage::eThreadState result = g_hooking->m_gta_thread_kill_hook.get_original<decltype(>a_thread_kill)>()(thread);
|
|
|
|
|
2022-03-21 18:10:18 +01:00
|
|
|
if (g->notifications.gta_thread_kill.log)
|
|
|
|
LOG(INFO) << "Script Thread '" << thread->m_name << "' terminated.";
|
|
|
|
if (g->notifications.gta_thread_kill.notify)
|
|
|
|
g_notification_service->push("Script Thread Termination", fmt::format("Script Thread '{}' terminated.", thread->m_name));
|
|
|
|
|
2022-01-21 23:13:10 +01:00
|
|
|
g_native_hooks->do_cleanup_for_thread(thread);
|
|
|
|
|
|
|
|
if (thread->m_script_hash == RAGE_JOAAT("freemode"))
|
2022-02-22 01:18:49 +01:00
|
|
|
g->protections.freemode_terminated = !(result == rage::eThreadState::running);
|
2022-01-21 23:13:10 +01:00
|
|
|
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
}
|