summaryrefslogtreecommitdiffstats
path: root/src/entities
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-06-30 15:27:20 +0200
committerGitHub <noreply@github.com>2019-06-30 15:27:20 +0200
commit6e4df804f7e8d6ec801e2699df7c036c82fcadac (patch)
tree15ccabed4c8c5d7c5c2f7a636035876cbd183e4d /src/entities
parentMerge pull request #78 from ShFil119/cleanup (diff)
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-6e4df804f7e8d6ec801e2699df7c036c82fcadac.tar
re3-6e4df804f7e8d6ec801e2699df7c036c82fcadac.tar.gz
re3-6e4df804f7e8d6ec801e2699df7c036c82fcadac.tar.bz2
re3-6e4df804f7e8d6ec801e2699df7c036c82fcadac.tar.lz
re3-6e4df804f7e8d6ec801e2699df7c036c82fcadac.tar.xz
re3-6e4df804f7e8d6ec801e2699df7c036c82fcadac.tar.zst
re3-6e4df804f7e8d6ec801e2699df7c036c82fcadac.zip
Diffstat (limited to '')
-rw-r--r--src/entities/Ped.cpp1
-rw-r--r--src/entities/Ped.h1
-rw-r--r--src/entities/Vehicle.cpp3
-rw-r--r--src/entities/Vehicle.h1
4 files changed, 6 insertions, 0 deletions
diff --git a/src/entities/Ped.cpp b/src/entities/Ped.cpp
index bc1a5203..14aad60a 100644
--- a/src/entities/Ped.cpp
+++ b/src/entities/Ped.cpp
@@ -30,6 +30,7 @@ CVector &CPed::offsetToOpenVanDoor = *(CVector*)0x62E048;
void *CPed::operator new(size_t sz) { return CPools::GetPedPool()->New(); }
void *CPed::operator new(size_t sz, int handle) { return CPools::GetPedPool()->New(handle); }
void CPed::operator delete(void *p, size_t sz) { CPools::GetPedPool()->Delete((CPed*)p); }
+void CPed::operator delete(void *p, int handle) { CPools::GetPedPool()->Delete((CPed*)p); }
CPed::~CPed(void)
{
diff --git a/src/entities/Ped.h b/src/entities/Ped.h
index 2edbd9e2..8f4939fc 100644
--- a/src/entities/Ped.h
+++ b/src/entities/Ped.h
@@ -272,6 +272,7 @@ public:
static void *operator new(size_t);
static void *operator new(size_t, int);
static void operator delete(void*, size_t);
+ static void operator delete(void*, int);
~CPed(void);
void FlagToDestroyWhenNextProcessed(void);
diff --git a/src/entities/Vehicle.cpp b/src/entities/Vehicle.cpp
index bcbaee32..8c1ef515 100644
--- a/src/entities/Vehicle.cpp
+++ b/src/entities/Vehicle.cpp
@@ -16,6 +16,7 @@ bool &CVehicle::bCheat5 = *(bool *)0x95CD64;
void *CVehicle::operator new(size_t sz) { return CPools::GetVehiclePool()->New(); }
void *CVehicle::operator new(size_t sz, int handle) { return CPools::GetVehiclePool()->New(handle); }
void CVehicle::operator delete(void *p, size_t sz) { CPools::GetVehiclePool()->Delete((CVehicle*)p); }
+void CVehicle::operator delete(void *p, int handle) { CPools::GetVehiclePool()->Delete((CVehicle*)p); }
CVehicle::~CVehicle()
{
@@ -25,6 +26,8 @@ CVehicle::~CVehicle()
m_audioEntityId = -5;
}
CRadar::ClearBlipForEntity(BLIP_CAR, CPools::GetVehiclePool()->GetIndex(this));
+ if (pDriver)
+ pDriver->FlagToDestroyWhenNextProcessed();
for (int i = 0; i < m_nNumMaxPassengers; i++){
if (pPassengers[i])
pPassengers[i]->FlagToDestroyWhenNextProcessed();
diff --git a/src/entities/Vehicle.h b/src/entities/Vehicle.h
index eed8f7a8..997720f6 100644
--- a/src/entities/Vehicle.h
+++ b/src/entities/Vehicle.h
@@ -113,6 +113,7 @@ public:
static void *operator new(size_t);
static void *operator new(size_t sz, int slot);
static void operator delete(void*, size_t);
+ static void operator delete(void*, int);
~CVehicle(void);