feat(Self): Better no ragdoll

This commit is contained in:
karifeld 2021-12-19 14:02:38 +08:00 committed by GitHub
parent 28b1224898
commit 802aee41af

View File

@ -3,19 +3,10 @@
namespace big
{
static bool bLastNoRagdoll = false;
void looped::self_no_ragdoll()
{
bool bNoRagdoll = g.self.no_ragdoll;
Ped player = PLAYER::PLAYER_PED_ID();
if ((bNoRagdoll && PED::IS_PED_RUNNING_RAGDOLL_TASK(player)) || (!bNoRagdoll && bNoRagdoll != bLastNoRagdoll))
{
if (ENTITY::GET_ENTITY_HEIGHT_ABOVE_GROUND(player) < 1.0)
TASK::CLEAR_PED_TASKS_IMMEDIATELY(player);
bLastNoRagdoll = bNoRagdoll;
}
PED::SET_PED_CAN_RAGDOLL(player, !g.self.no_ragdoll);
}
}
}