diff options
author | aap <aap@papnet.eu> | 2020-05-20 12:40:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-20 12:40:59 +0200 |
commit | 98b158c783e7e010b19aee22e452f1233a8f1ec2 (patch) | |
tree | 675e1d491bd8f9cb80c707fbba45ae41005a4d31 /src/vehicles/Boat.cpp | |
parent | Merge pull request #567 from erorcun/miami (diff) | |
parent | sync with upstream (diff) | |
download | re3-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 'src/vehicles/Boat.cpp')
-rw-r--r-- | src/vehicles/Boat.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
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){ |