mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-19 07:28:04 +08:00
refactor: Only act on an entity if we have control
This commit is contained in:
parent
df92a95aa9
commit
121553a3f5
@ -85,10 +85,11 @@ namespace big
|
|||||||
}
|
}
|
||||||
else if (bNoclip != bLastNoclip)
|
else if (bNoclip != bLastNoclip)
|
||||||
{
|
{
|
||||||
entity::take_control_of(ent);
|
if (entity::take_control_of(ent))
|
||||||
|
{
|
||||||
ENTITY::FREEZE_ENTITY_POSITION(ent, false);
|
ENTITY::FREEZE_ENTITY_POSITION(ent, false);
|
||||||
ENTITY::SET_ENTITY_COLLISION(ent, true, false);
|
ENTITY::SET_ENTITY_COLLISION(ent, true, false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bLastNoclip = bNoclip;
|
bLastNoclip = bNoclip;
|
||||||
|
@ -52,11 +52,12 @@ namespace big
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
entity::take_control_of(ent);
|
if (entity::take_control_of(ent) && ENTITY::IS_ENTITY_A_PED(ent) && !PED::IS_PED_RAGDOLL(ent))
|
||||||
|
{
|
||||||
|
TASK::SET_HIGH_FALL_TASK(ent, 0, 0, 0);
|
||||||
|
|
||||||
if (ENTITY::IS_ENTITY_A_PED(ent) && !PED::IS_PED_RAGDOLL(ent)) TASK::SET_HIGH_FALL_TASK(ent, 0, 0, 0);
|
notify::above_map("Selected entity at crosshair.");
|
||||||
|
}
|
||||||
notify::above_map("Selected entity at crosshair.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -75,7 +76,7 @@ namespace big
|
|||||||
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 15))
|
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 15))
|
||||||
dist += 5;
|
dist += 5;
|
||||||
|
|
||||||
entity::take_control_of(ent);
|
if (!entity::take_control_of(ent)) return;
|
||||||
|
|
||||||
ENTITY::SET_ENTITY_COLLISION(ent, false, false);
|
ENTITY::SET_ENTITY_COLLISION(ent, false, false);
|
||||||
|
|
||||||
|
@ -35,9 +35,7 @@ namespace big::vehicle
|
|||||||
|
|
||||||
inline bool repair(Vehicle veh)
|
inline bool repair(Vehicle veh)
|
||||||
{
|
{
|
||||||
if (!ENTITY::IS_ENTITY_A_VEHICLE(veh)) return false;
|
if (!ENTITY::IS_ENTITY_A_VEHICLE(veh) || !entity::take_control_of(veh)) return false;
|
||||||
|
|
||||||
entity::take_control_of(veh);
|
|
||||||
|
|
||||||
VEHICLE::SET_VEHICLE_FIXED(veh);
|
VEHICLE::SET_VEHICLE_FIXED(veh);
|
||||||
VEHICLE::SET_VEHICLE_DEFORMATION_FIXED(veh);
|
VEHICLE::SET_VEHICLE_DEFORMATION_FIXED(veh);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user