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/protections/render_entity.cpp
maybegreat48 e7562bcdff
Improve protections and other random changes (#1803)
* feat(protections): better logging
* feat(protections): improve protections
* fix(globals): save all spoofing settings
2023-07-22 23:18:47 +02:00

20 lines
495 B
C++

#include "hooking.hpp"
#include "pointers.hpp"
namespace big
{
void hooks::render_entity(__int64 renderer, rage::fwEntity* entity, int unk, bool a4)
{
if (*(int*)(((__int64)(*g_pointers->m_gta.m_draw_handler_mgr) + 0x14730)) >= 512)
{
*(int*)(renderer + 4) &= ~0x80000000;
*(int*)(renderer + 4) &= ~0x40000000;
*(int*)(renderer + 4) |= (a4 & 1) << 30;
*(int*)renderer = -2;
}
else
{
g_hooking->get_original<hooks::render_entity>()(renderer, entity, unk, a4);
}
}
}