summaryrefslogtreecommitdiffstats
path: root/src/vehicles
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-20 12:40:59 +0200
committerGitHub <noreply@github.com>2020-05-20 12:40:59 +0200
commit98b158c783e7e010b19aee22e452f1233a8f1ec2 (patch)
tree675e1d491bd8f9cb80c707fbba45ae41005a4d31 /src/vehicles
parentMerge pull request #567 from erorcun/miami (diff)
parentsync with upstream (diff)
downloadre3-98b158c783e7e010b19aee22e452f1233a8f1ec2.tar
re3-98b158c783e7e010b19aee22e452f1233a8f1ec2.tar.gz
re3-98b158c783e7e010b19aee22e452f1233a8f1ec2.tar.bz2
re3-98b158c783e7e010b19aee22e452f1233a8f1ec2.tar.lz
re3-98b158c783e7e010b19aee22e452f1233a8f1ec2.tar.xz
re3-98b158c783e7e010b19aee22e452f1233a8f1ec2.tar.zst
re3-98b158c783e7e010b19aee22e452f1233a8f1ec2.zip
Diffstat (limited to '')
-rw-r--r--src/vehicles/Automobile.cpp7
-rw-r--r--src/vehicles/Boat.cpp9
-rw-r--r--src/vehicles/Vehicle.cpp1
-rw-r--r--src/vehicles/Vehicle.h8
4 files changed, 23 insertions, 2 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index e0ee0296..524067ca 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -2853,6 +2853,7 @@ CAutomobile::ProcessBuoyancy(void)
if(impulseRatio > 0.5f){
bIsInWater = true;
+ bIsDrowning = true;
if(m_vecMoveSpeed.z < -0.1f)
m_vecMoveSpeed.z = -0.1f;
@@ -2867,8 +2868,11 @@ CAutomobile::ProcessBuoyancy(void)
if(pPassengers[i]->IsPlayer() || !bWaterTight)
pPassengers[i]->InflictDamage(nil, WEAPONTYPE_DROWNING, CTimer::GetTimeStep(), PEDPIECE_TORSO, 0);
}
- }else
+ }
+ else {
bIsInWater = false;
+ bIsDrowning = false;
+ }
static uint32 nGenerateRaindrops = 0;
static uint32 nGenerateWaterCircles = 0;
@@ -2950,6 +2954,7 @@ CAutomobile::ProcessBuoyancy(void)
}
}else{
bIsInWater = false;
+ bIsDrowning = false;
bTouchingWater = false;
static RwRGBA splashCol = {155, 155, 185, 196};
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 1e7f8ecf..c4ac94a2 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -273,9 +273,17 @@ CBoat::ProcessControl(void)
if(0.1f * m_fMass * GRAVITY*CTimer::GetTimeStep() < buoyanceImpulse.z){
bBoatInWater = true;
bIsInWater = true;
+ if (GetUp().z < -0.6f && Abs(GetMoveSpeed().x) < 0.05 && Abs(GetMoveSpeed().y) < 0.05) {
+ bIsDrowning = true;
+ if (pDriver)
+ pDriver->InflictDamage(nil, WEAPONTYPE_DROWNING, CTimer::GetTimeStep(), PEDPIECE_TORSO, 0);
+ }
+ else
+ bIsDrowning = false;
}else{
bBoatInWater = false;
bIsInWater = false;
+ bIsDrowning = false;
}
m_fVolumeUnderWater = mod_Buoyancy.m_volumeUnderWater;
@@ -519,6 +527,7 @@ CBoat::ProcessControl(void)
}else{
bBoatInWater = false;
bIsInWater = false;
+ bIsDrowning = false;
}
if(m_bIsAnchored){
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index c90370f6..58c68a8d 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -104,6 +104,7 @@ CVehicle::CVehicle(uint8 CreatedBy)
m_nCarHornPattern = 0;
m_nCarHornDelay = 0;
bPartOfConvoy = false;
+ bIsDrowning = false;
bCreatedAsPoliceVehicle = false;
bParking = false;
m_nAlarmState = 0;
diff --git a/src/vehicles/Vehicle.h b/src/vehicles/Vehicle.h
index bbf15c00..0b7d3cba 100644
--- a/src/vehicles/Vehicle.h
+++ b/src/vehicles/Vehicle.h
@@ -182,10 +182,16 @@ public:
uint8 bVehicleColProcessed : 1;// Has ProcessEntityCollision been processed for this car?
uint8 bIsCarParkVehicle : 1; // Car has been created using the special CAR_PARK script command
uint8 bHasAlreadyBeenRecorded : 1; // Used for replays
-
uint8 bPartOfConvoy : 1;
+ //uint8 bHeliMinimumTilt : 1; // This heli should have almost no tilt really
+ //uint8 bAudioChangingGear : 1; // sounds like vehicle is changing gear
+
+ uint8 bIsDrowning : 1; // is vehicle occupants taking damage in water (i.e. vehicle is dead in water)
+ //uint8 bTyresDontBurst : 1; // If this is set the tyres are invincible
uint8 bCreatedAsPoliceVehicle : 1;// True if this guy was created as a police vehicle (enforcer, policecar, miamivice car etc)
+ //uint8 bRestingOnPhysical : 1; // Dont go static cause car is sitting on a physical object that might get removed
uint8 bParking : 1;
+ //uint8 bCanPark : 1;
uint8 m_bombType : 3;