[saco] Implement CTaskJetpack constructor and destructor

This commit is contained in:
RD42 2024-05-02 21:49:22 +08:00
parent 161bc72d96
commit b5e5b572d9
2 changed files with 49 additions and 0 deletions

View File

@ -276,3 +276,43 @@ BOOL CTask::IsSimple()
return bRet;
}
//==========================================================
// JETPACK TASK
CTaskJetpack::CTaskJetpack()
{
m_pPlayerPed = NULL;
Create(112);
BYTE *pTaskType = m_pTaskType;
__asm
{
push 0;
push 0;
push 0x41200000; // 10.0f
push 0;
mov ecx, pTaskType;
mov eax, 0x67B4E0; // CTaskJetpack_CreateJetpack
call eax;
}
}
//----------------------------------------------------------
CTaskJetpack::CTaskJetpack(BYTE *pTaskType)
{
m_pPlayerPed = NULL;
Create(pTaskType);
}
//----------------------------------------------------------
CTaskJetpack::~CTaskJetpack()
{
if (m_pPlayerPed)
m_pPlayerPed->m_pPed->Tasks->pdwJumpJetPack = NULL;
CTask::Destroy();
}

View File

@ -32,3 +32,12 @@ public:
};
class CTaskJetpack :
public CTask
{
public:
CTaskJetpack();
CTaskJetpack(BYTE *pTaskType);
~CTaskJetpack();
};