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/src/hooks/script/gta_thread_kill.cpp
Yimura f6c00f113d
refactor!: globals (#717)
* refactor(globals): use macro's for to_json/from_json
* refactor(globals): switch from global pointer to global instance
2022-12-18 22:15:52 +00:00

27 lines
766 B
C++

#include "hooking.hpp"
#include "native_hooks/native_hooks.hpp"
namespace big
{
rage::eThreadState hooks::gta_thread_kill(GtaThread* thread)
{
const auto result = g_hooking->get_original<gta_thread_kill>()(thread);
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", std::format("Script Thread '{}' terminated.", thread->m_name));
if (thread == g.m_hunt_the_beast_thread)
g.m_hunt_the_beast_thread = nullptr;
if (thread == g.m_dance_thread)
g.m_dance_thread = nullptr;
if (thread == g.m_mission_creator_thread)
g.m_mission_creator_thread = nullptr;
return result;
}
}