feat(Entity): Patch Request Control of Entity

This commit is contained in:
Yimura 2021-05-26 00:14:28 +02:00
parent 7a99637cec
commit 4746754fb8
2 changed files with 7 additions and 4 deletions

View File

@ -159,6 +159,13 @@ namespace big
m_send_event_ack = ptr.sub(5).as<decltype(m_send_event_ack)>();
});
// Received Event Signatures END
main_batch.add("Request Control Of Entity", "48 89 5C 24 ? 57 48 83 EC 20 8B D9 E8 ? ? ? ? 84 C0", [this](memory::handle ptr)
{
PVOID spectator_check = ptr.add(0x11).as<PVOID>();
memset(spectator_check, 0x90, 0x4);
});
main_batch.run(memory::module(nullptr));

View File

@ -51,13 +51,9 @@ namespace big::entity
if (NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return true;
for (uint8_t i = 0; !NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent) && i < 5; i++)
{
bool in_spectator = NETWORK::NETWORK_IS_IN_SPECTATOR_MODE();
if (in_spectator) NETWORK::NETWORK_SET_IN_SPECTATOR_MODE(0, PLAYER::PLAYER_PED_ID());
NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ent);
if (in_spectator) NETWORK::NETWORK_SET_IN_SPECTATOR_MODE(1, PLAYER::PLAYER_PED_ID());
script::get_current()->yield();
}
if (!NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return false;