diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-19 19:54:05 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-05-19 19:54:05 +0200 |
commit | 4c822e8375268ac34f92af3f1960965446d32506 (patch) | |
tree | 50c0d7d8c2514880f9148a2edc655954eb500191 /src/vehicles/Boat.cpp | |
parent | Merge remote-tracking branch 'upstream/miami' into miami (diff) | |
download | re3-4c822e8375268ac34f92af3f1960965446d32506.tar re3-4c822e8375268ac34f92af3f1960965446d32506.tar.gz re3-4c822e8375268ac34f92af3f1960965446d32506.tar.bz2 re3-4c822e8375268ac34f92af3f1960965446d32506.tar.lz re3-4c822e8375268ac34f92af3f1960965446d32506.tar.xz re3-4c822e8375268ac34f92af3f1960965446d32506.tar.zst re3-4c822e8375268ac34f92af3f1960965446d32506.zip |
Diffstat (limited to '')
-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){ |