From a7ffe337211adb72a215baf946404ff636f2fdf7 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Sat, 2 Nov 2024 22:42:58 +0800 Subject: [PATCH] [saco] Implement/match `CPlayerPed::IsJumping()` --- saco/game/playerped.cpp | 11 +++++++++++ saco/game/playerped.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/saco/game/playerped.cpp b/saco/game/playerped.cpp index dc7bf95..5a1876d 100644 --- a/saco/game/playerped.cpp +++ b/saco/game/playerped.cpp @@ -957,6 +957,17 @@ void CPlayerPed::HoldItem(int iObject) //----------------------------------------------------------- +BOOL CPlayerPed::IsJumping() +{ + if(m_pPed && !IN_VEHICLE(m_pPed) && m_pPed->Tasks->pdwJumpJetPack) + { + return GetTaskTypeFromTask(m_pPed->Tasks->pdwJumpJetPack) == 211; + } + return FALSE; +} + +//----------------------------------------------------------- + void CPlayerPed::StartJetpack() { if(!m_pPed) return; diff --git a/saco/game/playerped.h b/saco/game/playerped.h index 0231639..79e0b4f 100644 --- a/saco/game/playerped.h +++ b/saco/game/playerped.h @@ -108,6 +108,8 @@ public: BOOL HasHandsUp(); void HoldItem(int iObject); + BOOL IsJumping(); + float GetAimZ(); void SetAimZ(float fAimZ);