Merge pull request #11 from karifeld/master

feat(Self): Better no ragdoll
This commit is contained in:
Yimura 2021-12-19 13:00:52 +01:00 committed by GitHub
commit 2fa3ebd789

View File

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