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

This commit is contained in:
RD42 2024-11-02 22:52:02 +08:00
parent 38470a88e1
commit f829baf38c
3 changed files with 14 additions and 1 deletions

View File

@ -79,8 +79,9 @@ typedef struct _PED_TASKS_TYPE
// Basic Tasks // Basic Tasks
DWORD * pdwDamage; DWORD * pdwDamage;
char _gap8[8]; char _gap8[4];
DWORD * pdwSwimWasted;
DWORD * pdwJumpJetPack; DWORD * pdwJumpJetPack;
char _gap14[4]; char _gap14[4];

View File

@ -990,6 +990,17 @@ BOOL CPlayerPed::IsFalling()
//----------------------------------------------------------- //-----------------------------------------------------------
BOOL CPlayerPed::IsSwimming()
{
if(m_pPed && !IN_VEHICLE(m_pPed) && m_pPed->Tasks->pdwSwimWasted)
{
return GetTaskTypeFromTask(m_pPed->Tasks->pdwSwimWasted) == 268;
}
return FALSE;
}
//-----------------------------------------------------------
void CPlayerPed::StartJetpack() void CPlayerPed::StartJetpack()
{ {
if(!m_pPed) return; if(!m_pPed) return;

View File

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