mirror of
https://github.com/dashr9230/SA-MP.git
synced 2026-10-11 01:38:17 +08:00
[saco] Implement CPlayerPed::Destroy and match ~CPlayerPed; the destructor body is just Destroy()
This commit is contained in:
1 parent
3e0b45b61e
commit
6cbbd15928
2 files changed
+45
No files matched your search
@@ -1293,6 +1293,50 @@ void CPlayerPed::SetSkin(int iSkin)
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
CPlayerPed::~CPlayerPed()
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CPlayerPed::Destroy()
|
||||
{
|
||||
DWORD dwPedPtr = (DWORD)m_pPed;
|
||||
|
||||
GameResetPlayerKeys(m_bytePlayerNumber);
|
||||
SetPlayerPedPtrRecord(m_bytePlayerNumber, 0);
|
||||
|
||||
if(m_pPed && GamePool_Ped_GetAt(m_dwGTAId) && m_pPed->entity.vtable != 0x863C40) {
|
||||
if(field_2B9) {
|
||||
ScriptCommand(&disassociate_object, field_2B9, 0.0f, 0.0f, 0.0f, 0);
|
||||
ScriptCommand(&destroy_object_with_fade, field_2B9);
|
||||
field_2B9 = 0;
|
||||
}
|
||||
|
||||
if(HasObjectAttached()) RemoveAllAttachedObjects();
|
||||
if(field_2C1) StopCarrying();
|
||||
|
||||
if(IN_VEHICLE(m_pPed)) RemoveFromVehicleAndPutAt(100.0f, 100.0f, 10.0f);
|
||||
|
||||
*(DWORD *)(*(DWORD *)(dwPedPtr + 1152) + 76) = 0;
|
||||
|
||||
_asm mov ecx, dwPedPtr
|
||||
_asm push 1
|
||||
_asm mov eax, [ecx]
|
||||
_asm call dword ptr [eax]
|
||||
|
||||
m_pPed = NULL;
|
||||
m_pEntity = NULL;
|
||||
} else {
|
||||
m_pPed = NULL;
|
||||
m_pEntity = NULL;
|
||||
m_dwGTAId = 0;
|
||||
}
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
||||
void CPlayerPed::RemoveAllAttachedObjects()
|
||||
{
|
||||
// retail spells the RemoveAttachedObject body out here
|
||||
|
||||
@@ -124,6 +124,7 @@ public:
|
||||
BOOL IsPerformingAnimation(char *szAnimName);
|
||||
|
||||
CPlayerPed();
|
||||
~CPlayerPed();
|
||||
|
||||
int sub_100ADFA0(); // .text:100ADFA0
|
||||
void FUNC_100ADFB0(int iLevel); // .text:100ADFB0
|
||||
|
||||
Reference in new issue
Block a user