mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[saco] Implement/match CActorPed::Destroy()
This commit is contained in:
parent
94bfbc8947
commit
a4657baccf
@ -34,3 +34,28 @@ CActorPed::CActorPed(int iSkin, float fX, float fY,float fZ,float fRotation)
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CActorPed::Destroy()
|
||||
{
|
||||
DWORD dwPedPtr = (DWORD)m_pPed;
|
||||
|
||||
// If it points to the CPlaceable vtable it's not valid
|
||||
if(!m_pPed || !GamePool_Ped_GetAt(m_dwGTAId) || m_pPed->entity.vtable == 0x863C40)
|
||||
{
|
||||
m_pPed = NULL;
|
||||
m_pEntity = NULL;
|
||||
m_dwGTAId = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
// DESTROY METHOD
|
||||
_asm mov ecx, dwPedPtr
|
||||
_asm mov ebx, [ecx] ; vtable
|
||||
_asm push 1
|
||||
_asm call [ebx] ; destroy
|
||||
|
||||
m_pPed = NULL;
|
||||
m_pEntity = NULL;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
|
@ -6,9 +6,13 @@
|
||||
class CActorPed : public CEntity
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructor/Destructor.
|
||||
CActorPed(int iSkin, float fPosX, float fPosY, float fPosZ, float fRotation = 0.0f);
|
||||
|
||||
void Destroy();
|
||||
|
||||
|
||||
PED_TYPE *m_pPed;
|
||||
DWORD m_dwMarkerID;
|
||||
DWORD m_dwArrow;
|
||||
|
Loading…
Reference in New Issue
Block a user