diff options
author | aap <aap@papnet.eu> | 2019-06-30 13:03:04 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-30 13:03:04 +0200 |
commit | ffb9fe188c6c58e22683dbc669c1e142a2feb166 (patch) | |
tree | 7e3436ed3945245fca67127d00e0ccfee6d31239 /src/entities/Vehicle.cpp | |
parent | fix (diff) | |
parent | PlayBackThisFrameInterpolation and all it required... (diff) | |
download | re3-ffb9fe188c6c58e22683dbc669c1e142a2feb166.tar re3-ffb9fe188c6c58e22683dbc669c1e142a2feb166.tar.gz re3-ffb9fe188c6c58e22683dbc669c1e142a2feb166.tar.bz2 re3-ffb9fe188c6c58e22683dbc669c1e142a2feb166.tar.lz re3-ffb9fe188c6c58e22683dbc669c1e142a2feb166.tar.xz re3-ffb9fe188c6c58e22683dbc669c1e142a2feb166.tar.zst re3-ffb9fe188c6c58e22683dbc669c1e142a2feb166.zip |
Diffstat (limited to '')
-rw-r--r-- | src/entities/Vehicle.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/entities/Vehicle.cpp b/src/entities/Vehicle.cpp index ced504a3..bcbaee32 100644 --- a/src/entities/Vehicle.cpp +++ b/src/entities/Vehicle.cpp @@ -4,6 +4,8 @@ #include "Pools.h" #include "CarCtrl.h" #include "ModelIndices.h" +#include "DMAudio.h" +#include "Radar.h" bool &CVehicle::bWheelsOnlyCheat = *(bool *)0x95CD78; bool &CVehicle::bAllDodosCheat = *(bool *)0x95CD75; @@ -12,8 +14,34 @@ bool &CVehicle::bCheat4 = *(bool *)0x95CD65; 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); } +CVehicle::~CVehicle() +{ + m_nAlarmState = 0; + if (m_audioEntityId >= 0){ + DMAudio.DestroyEntity(m_audioEntityId); + m_audioEntityId = -5; + } + CRadar::ClearBlipForEntity(BLIP_CAR, CPools::GetVehiclePool()->GetIndex(this)); + for (int i = 0; i < m_nNumMaxPassengers; i++){ + if (pPassengers[i]) + pPassengers[i]->FlagToDestroyWhenNextProcessed(); + } + if (m_pCarFire) + m_pCarFire->Extinguish(); + CCarCtrl::UpdateCarCount(this, true); + if (bIsAmbulanceOnDuty){ + CCarCtrl::NumAmbulancesOnDuty--; + bIsAmbulanceOnDuty = false; + } + if (bIsFiretruckOnDuty){ + CCarCtrl::NumFiretrucksOnDuty--; + bIsFiretruckOnDuty = false; + } +} + bool CVehicle::IsLawEnforcementVehicle(void) { @@ -47,6 +75,28 @@ CVehicle::ChangeLawEnforcerState(bool enable) } void +CVehicle::RemovePassenger(CPed *p) +{ + if (IsTrain()){ + for (int i = 0; i < 8; i++){ + if (pPassengers[i] == p) { + pPassengers[i] = nil; + m_nNumPassengers--; + return; + } + } + return; + } + for (int i = 0; i < m_nNumMaxPassengers; i++){ + if (pPassengers[i] == p){ + pPassengers[i] = nil; + m_nNumPassengers--; + return; + } + } +} + +void CVehicle::RemoveDriver(void) { m_status = STATUS_ABANDONED; |