mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-17 23:07:26 +08:00
fix(Toxic): fix typo (#1062)
This commit is contained in:
parent
e5aa39dd35
commit
acf240dc17
@ -13,7 +13,7 @@ namespace big
|
|||||||
|
|
||||||
g_hooking->get_original<hooks::write_vehicle_proximity_migration_data_node>()(veh, node);
|
g_hooking->get_original<hooks::write_vehicle_proximity_migration_data_node>()(veh, node);
|
||||||
|
|
||||||
if (vehicle->m_net_object->m_object_id = g.m_tp_veh_net_id)
|
if (vehicle->m_net_object->m_object_id == g.m_tp_veh_net_id)
|
||||||
{
|
{
|
||||||
node->m_has_occupants[0] = true;
|
node->m_has_occupants[0] = true;
|
||||||
node->m_occupants[0] = g.m_tp_player_net_id;
|
node->m_occupants[0] = g.m_tp_player_net_id;
|
||||||
|
@ -72,22 +72,36 @@ namespace big::entity
|
|||||||
|
|
||||||
inline bool take_control_of(Entity ent, int timeout = 300)
|
inline bool take_control_of(Entity ent, int timeout = 300)
|
||||||
{
|
{
|
||||||
auto ptr = g_pointers->m_handle_to_ptr(ent);
|
if (auto hnd = g_pointers->m_handle_to_ptr(ent))
|
||||||
if (ptr)
|
|
||||||
{
|
{
|
||||||
if (!*g_pointers->m_is_session_started || network_has_control_of_entity(ptr->m_net_object))
|
if (!*g_pointers->m_is_session_started || !hnd->m_net_object || network_has_control_of_entity(hnd->m_net_object))
|
||||||
return true;
|
|
||||||
for (int i = 0; !network_has_control_of_entity(ptr->m_net_object) && i < timeout; i++)
|
|
||||||
{
|
{
|
||||||
g_pointers->m_request_control(ptr->m_net_object);
|
return true;
|
||||||
if (timeout != 0)
|
|
||||||
script::get_current()->yield();
|
|
||||||
}
|
}
|
||||||
if (!network_has_control_of_entity(ptr->m_net_object))
|
|
||||||
return false;
|
|
||||||
int netHandle = NETWORK::NETWORK_GET_NETWORK_ID_FROM_ENTITY(ent);
|
|
||||||
NETWORK::SET_NETWORK_ID_CAN_MIGRATE(netHandle, true);
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < timeout; i++)
|
||||||
|
{
|
||||||
|
auto hnd = g_pointers->m_handle_to_ptr(ent);
|
||||||
|
|
||||||
|
if (!hnd || !hnd->m_net_object)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
g_pointers->m_request_control(hnd->m_net_object);
|
||||||
|
if (timeout != 0)
|
||||||
|
script::get_current()->yield();
|
||||||
|
}
|
||||||
|
|
||||||
|
auto hnd = g_pointers->m_handle_to_ptr(ent);
|
||||||
|
if (!hnd || !hnd->m_net_object || !network_has_control_of_entity(hnd->m_net_object))
|
||||||
|
return false;
|
||||||
|
|
||||||
|
int netHandle = NETWORK::NETWORK_GET_NETWORK_ID_FROM_ENTITY(ent);
|
||||||
|
NETWORK::SET_NETWORK_ID_CAN_MIGRATE(netHandle, true);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user