Files
TmpMenu/src/native_hooks/all_scripts.hpp
T
Yimura c75a17256e Update for 1.66 (#929)
* feat(crossmap): update thanks @Aure7138

* feat(TSE): updated most hashes

* feat(ScriptEventHandler): Remove abused TSE hashes

* feat(pointers): fix snitl

* fix(pointers): region code

* fix(pointers): handle join request

* fix(pointers): decode session info

* fix(pointers): connect to peer

* fix(pointers): decode peer info

* fix(pointers): add player to session

* fix(pointers): handle join request

* fix(pointers): Is Matchmaking Session Valid

* fix(pointers): send session matchmaking attributes

* fix(pointers): process matchmaking find response

* fix(pointers): serialize join request message

* fix(TSE): updated lost few, thanks @Rimmuru

* fix(Menu): update menu (#930)

* fix(globals): mechanic global

* feat(meta): bump version

* feat(spoofing): remove patched stuff

* fix(self): off radar timer offset

* fix(overlay): retain last position

* feat(self): commented dance mode

* feat(spoofing): add note about spoofing not working

Co-authored-by: maybegreat48 <96936658+maybegreat48@users.noreply.github.com>
2023-02-03 23:00:56 +00:00

53 lines
1.9 KiB
C++

#pragma once
#include "native_hooks.hpp"
#include "natives.hpp"
#include "core/scr_globals.hpp"
#include "fiber_pool.hpp"
#include "util/scripts.hpp"
#include "hooking.hpp"
namespace big
{
namespace all_scripts
{
void IS_DLC_PRESENT(rage::scrNativeCallContext* src)
{
const auto hash = src->get_arg<rage::joaat_t>(0);
BOOL return_value = DLC::IS_DLC_PRESENT(hash);
if (hash == 0x96F02EE6)
return_value = return_value || g.settings.dev_dlc;
src->set_return_value<BOOL>(return_value);
}
void NETWORK_SET_THIS_SCRIPT_IS_NETWORK_SCRIPT(rage::scrNativeCallContext* src)
{
if (rage::scrThread::get() && rage::scrThread::get()->m_handler)
{
if (auto hook = g_hooking->m_handler_hooks[(CGameScriptHandler*)rage::scrThread::get()->m_handler].get())
{
hook->disable();
g_hooking->m_handler_hooks.erase((CGameScriptHandler*)rage::scrThread::get()->m_handler);
}
}
NETWORK::NETWORK_SET_THIS_SCRIPT_IS_NETWORK_SCRIPT(src->get_arg<int>(0), src->get_arg<BOOL>(1), src->get_arg<int>(2));
}
void NETWORK_TRY_TO_SET_THIS_SCRIPT_IS_NETWORK_SCRIPT(rage::scrNativeCallContext* src)
{
if (rage::scrThread::get() && rage::scrThread::get()->m_handler)
{
if (auto hook = g_hooking->m_handler_hooks[(CGameScriptHandler*)rage::scrThread::get()->m_handler].get())
{
hook->disable();
g_hooking->m_handler_hooks.erase((CGameScriptHandler*)rage::scrThread::get()->m_handler);
}
}
src->set_return_value<BOOL>(NETWORK::NETWORK_TRY_TO_SET_THIS_SCRIPT_IS_NETWORK_SCRIPT(src->get_arg<int>(0), src->get_arg<BOOL>(1), src->get_arg<int>(2)));
}
}
}