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

This commit is contained in:
RD42 2024-11-02 22:48:04 +08:00
parent a7ffe33721
commit 975fdd589e
3 changed files with 20 additions and 0 deletions

View File

@ -70,11 +70,19 @@ typedef struct _WEAPON_SLOT_TYPE
} WEAPON_SLOT_TYPE; // MUST BE EXACTLY ALIGNED TO 28 bytes
//-----------------------------------------------------------
#pragma pack(1)
typedef struct _PED_TASKS_TYPE
{
char _gap0[16];
DWORD * pdwJumpJetPack;
char _gap14[4];
// Extended Tasks
DWORD * pdwFighting;
} PED_TASKS_TYPE;
//-----------------------------------------------------------

View File

@ -968,6 +968,17 @@ BOOL CPlayerPed::IsJumping()
//-----------------------------------------------------------
BOOL CPlayerPed::IsFighting()
{
if(m_pPed && !IN_VEHICLE(m_pPed) && m_pPed->Tasks->pdwFighting)
{
return GetTaskTypeFromTask(m_pPed->Tasks->pdwFighting) == 1016;
}
return FALSE;
}
//-----------------------------------------------------------
void CPlayerPed::StartJetpack()
{
if(!m_pPed) return;

View File

@ -109,6 +109,7 @@ public:
void HoldItem(int iObject);
BOOL IsJumping();
BOOL IsFighting();
float GetAimZ();
void SetAimZ(float fAimZ);