This repository has been archived on 2024-10-22. You can view files and clone it, but cannot push or open issues or pull requests.
YimMenu/BigBaseV2/src/hooks/native_hooks/gta_thread_start.cpp

23 lines
716 B
C++
Raw Normal View History

#include "hooking.hpp"
#include "native_hooks/native_hooks.hpp"
namespace big
{
GtaThread* hooks::gta_thread_start(unsigned int** a1, unsigned int a2)
{
GtaThread* new_thread = g_hooking->m_gta_thread_start_hook.get_original<decltype(&hooks::gta_thread_start)>()(a1, a2);
if (const char* name = new_thread->m_name; strlen(name) > 0)
{
if (g->notifications.gta_thread_kill.log)
LOG(INFO) << "Script Thread '" << name << "' started.";
if (g->notifications.gta_thread_kill.notify)
2022-10-24 14:08:37 +02:00
g_notification_service->push("Script Thread Startup", std::format("Script Thread '{}' started.", name));
}
if (new_thread != nullptr)
g_native_hooks->check_for_thread(new_thread);
return new_thread;
}
}