diff --git a/saco/game/common.h b/saco/game/common.h index 0830fa9..af4aba1 100644 --- a/saco/game/common.h +++ b/saco/game/common.h @@ -79,8 +79,9 @@ typedef struct _PED_TASKS_TYPE // Basic Tasks DWORD * pdwDamage; - char _gap8[8]; + char _gap8[4]; + DWORD * pdwSwimWasted; DWORD * pdwJumpJetPack; char _gap14[4]; diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index a32fa30..b765510 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -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() { if(!m_pPed) return; diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 0c24b86..d83d60f 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -111,6 +111,7 @@ public: BOOL IsJumping(); BOOL IsFighting(); BOOL IsFalling(); + BOOL IsSwimming(); float GetAimZ(); void SetAimZ(float fAimZ);