mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-01-03 16:13:36 +08:00
feat(Entity): Wait a bit before requesting control again
This commit is contained in:
parent
23fd89706d
commit
97a493646f
@ -49,12 +49,11 @@ namespace big::entity
|
|||||||
inline bool take_control_of(Entity ent)
|
inline bool take_control_of(Entity ent)
|
||||||
{
|
{
|
||||||
if (NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return true;
|
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++)
|
for (uint8_t i = 0; !NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent) && i < 10; i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ent);
|
NETWORK::NETWORK_REQUEST_CONTROL_OF_ENTITY(ent);
|
||||||
|
|
||||||
script::get_current()->yield();
|
script::get_current()->yield(5ms);
|
||||||
}
|
}
|
||||||
if (!NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return false;
|
if (!NETWORK::NETWORK_HAS_CONTROL_OF_ENTITY(ent)) return false;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user