feat(Spoofing): add interior and cutscene check (#803)

This commit is contained in:
TheGreenBandit 2023-01-07 07:31:57 -05:00 committed by GitHub
parent 5260b27899
commit 081dd6d694
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,13 +1,18 @@
#include "hooking.hpp"
#include <datanodes/player/CPlayerGameStateDataNode.hpp>
#include "natives.hpp"
namespace big
{
bool is_player_in_cutscene(Player player) { return NETWORK::NETWORK_IS_PLAYER_IN_MP_CUTSCENE(player); }
bool is_player_in_interior(Ped player) { return (INTERIOR::GET_INTERIOR_FROM_ENTITY(player) != 0); }
bool hooks::write_player_game_state_data_node(rage::netObject* player, CPlayerGameStateDataNode* node)
{
auto ret = g_hooking->get_original<write_player_game_state_data_node>()(player, node);
if (g.spoofing.spoof_hide_god)
if (g.spoofing.spoof_hide_god && !is_player_in_cutscene(self::id) && !is_player_in_interior(self::ped))
{
node->m_is_invincible = false;
node->m_bullet_proof = false;