[saco] Implement/match CEntity::Remove()

This commit is contained in:
RD42 2024-08-06 19:08:47 +08:00
parent e3320fd439
commit 4fd253f52e
2 changed files with 34 additions and 0 deletions

View File

@ -1,7 +1,15 @@
#include <windows.h>
#include <math.h>
#include <stdio.h>
#include "../main.h"
#include "util.h"
#include "entity.h"
extern CGame *pGame;
extern CNetGame *pNetGame;
extern CChatWindow *pChatWindow;
//-----------------------------------------------------------
@ -299,3 +307,28 @@ BOOL CEntity::IsAdded()
//-----------------------------------------------------------
void CEntity::Remove()
{
// Check for CPlaceable messup
if(!m_pEntity || m_pEntity->vtable == 0x863C40)
{
#ifdef _DEBUG
OutputDebugString("CEntity::Remove - m_pEntity == NULL or CPlaceable");
#endif
return;
}
if(m_pEntity->dwUnkModelRel) {
WorldRemoveEntity((PDWORD)m_pEntity);
#ifdef _DEBUG
if (IsAdded())
{
OutputDebugString("CEntity::Remove failed...");
}
#endif
}
}
//-----------------------------------------------------------

View File

@ -32,6 +32,7 @@ public:
BOOL FUNC_1009FDE0();
virtual void Add();
virtual void Remove();
BOOL IsAdded();
VECTOR field_4[5];