mirror of
https://github.com/Mr-X-GTA/YimMenu.git
synced 2025-06-18 23:17:52 +08:00
refactor(GravityGun): Fixed cleanup of selected entity
This commit is contained in:
parent
6621562d89
commit
adcee2f487
@ -19,10 +19,8 @@ namespace big
|
|||||||
bool bGravityGun = g.weapons.custom_weapon == CustomWeapon::GRAVITY_GUN;
|
bool bGravityGun = g.weapons.custom_weapon == CustomWeapon::GRAVITY_GUN;
|
||||||
double multiplier = 3.0;
|
double multiplier = 3.0;
|
||||||
|
|
||||||
if (bGravityGun)
|
|
||||||
{
|
|
||||||
// ZOOMED IN
|
// ZOOMED IN
|
||||||
if (PAD::IS_DISABLED_CONTROL_PRESSED(0, 25))
|
if (bGravityGun && PAD::IS_DISABLED_CONTROL_PRESSED(0, 25))
|
||||||
{
|
{
|
||||||
PLAYER::DISABLE_PLAYER_FIRING(PLAYER::PLAYER_ID(), true);
|
PLAYER::DISABLE_PLAYER_FIRING(PLAYER::PLAYER_ID(), true);
|
||||||
for (int control : controls)
|
for (int control : controls)
|
||||||
@ -98,17 +96,14 @@ namespace big
|
|||||||
ENTITY::SET_ENTITY_ALPHA(ent, 105, 0);
|
ENTITY::SET_ENTITY_ALPHA(ent, 105, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ent != 0)
|
else if (ent != 0 && entity::take_control_of(ent))
|
||||||
{
|
{
|
||||||
entity::take_control_of(ent);
|
|
||||||
|
|
||||||
ENTITY::SET_ENTITY_COLLISION(ent, true, true);
|
ENTITY::SET_ENTITY_COLLISION(ent, true, true);
|
||||||
ENTITY::SET_ENTITY_ALPHA(ent, 255, 0);
|
ENTITY::RESET_ENTITY_ALPHA(ent);
|
||||||
|
|
||||||
ent = 0;
|
ent = 0;
|
||||||
|
|
||||||
notify::above_map("Released entity.");
|
notify::above_map("Released entity.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user