[saco] Implement/match CPlayerPed::IsFalling()

This commit is contained in:
RD42 2024-11-02 22:50:38 +08:00
parent 975fdd589e
commit 38470a88e1
3 changed files with 18 additions and 1 deletions

View File

@ -74,7 +74,12 @@ typedef struct _WEAPON_SLOT_TYPE
#pragma pack(1) #pragma pack(1)
typedef struct _PED_TASKS_TYPE typedef struct _PED_TASKS_TYPE
{ {
char _gap0[16]; char _gap0[4];
// Basic Tasks
DWORD * pdwDamage;
char _gap8[8];
DWORD * pdwJumpJetPack; DWORD * pdwJumpJetPack;

View File

@ -979,6 +979,17 @@ BOOL CPlayerPed::IsFighting()
//----------------------------------------------------------- //-----------------------------------------------------------
BOOL CPlayerPed::IsFalling()
{
if(m_pPed && !IN_VEHICLE(m_pPed) && m_pPed->Tasks->pdwDamage)
{
return GetTaskTypeFromTask(m_pPed->Tasks->pdwDamage) == 208;
}
return FALSE;
}
//-----------------------------------------------------------
void CPlayerPed::StartJetpack() void CPlayerPed::StartJetpack()
{ {
if(!m_pPed) return; if(!m_pPed) return;

View File

@ -110,6 +110,7 @@ public:
BOOL IsJumping(); BOOL IsJumping();
BOOL IsFighting(); BOOL IsFighting();
BOOL IsFalling();
float GetAimZ(); float GetAimZ();
void SetAimZ(float fAimZ); void SetAimZ(float fAimZ);