summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Vehicle.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-03-30 19:10:12 +0200
committerSergeanur <s.anureev@yandex.ua>2020-03-30 19:10:12 +0200
commit2607a91d87270709db4303ee8cb9011e2d9146ad (patch)
tree611cf59f1c46b60908057affe8d86eb9b39a23ad /src/vehicles/Vehicle.cpp
parentAdd russian lang support (diff)
parentMerge pull request #366 from Nick007J/master (diff)
downloadre3-2607a91d87270709db4303ee8cb9011e2d9146ad.tar
re3-2607a91d87270709db4303ee8cb9011e2d9146ad.tar.gz
re3-2607a91d87270709db4303ee8cb9011e2d9146ad.tar.bz2
re3-2607a91d87270709db4303ee8cb9011e2d9146ad.tar.lz
re3-2607a91d87270709db4303ee8cb9011e2d9146ad.tar.xz
re3-2607a91d87270709db4303ee8cb9011e2d9146ad.tar.zst
re3-2607a91d87270709db4303ee8cb9011e2d9146ad.zip
Diffstat (limited to 'src/vehicles/Vehicle.cpp')
-rw-r--r--src/vehicles/Vehicle.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index 54bc2c01..1fe02953 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -17,6 +17,7 @@
#include "DMAudio.h"
#include "Radar.h"
#include "Fire.h"
+#include "Darkel.h"
bool &CVehicle::bWheelsOnlyCheat = *(bool *)0x95CD78;
bool &CVehicle::bAllDodosCheat = *(bool *)0x95CD75;
@@ -765,6 +766,29 @@ CVehicle::IsSphereTouchingVehicle(float sx, float sy, float sz, float radius)
return true;
}
+void
+DestroyVehicleAndDriverAndPassengers(CVehicle* pVehicle)
+{
+ if (pVehicle->pDriver) {
+#ifndef FIX_BUGS
+ // this just isn't fair
+ CDarkel::RegisterKillByPlayer(pVehicle->pDriver, WEAPONTYPE_UNIDENTIFIED);
+#endif
+ pVehicle->pDriver->FlagToDestroyWhenNextProcessed();
+ }
+ for (int i = 0; i < pVehicle->m_nNumMaxPassengers; i++) {
+ if (pVehicle->pPassengers[i]) {
+#ifndef FIX_BUGS
+ // this just isn't fair
+ CDarkel::RegisterKillByPlayer(pVehicle->pPassengers[i], WEAPONTYPE_UNIDENTIFIED);
+#endif
+ pVehicle->pPassengers[i]->FlagToDestroyWhenNextProcessed();
+ }
+ }
+ CWorld::Remove(pVehicle);
+ delete pVehicle;
+}
+
class CVehicle_ : public CVehicle
{