diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-10-09 11:02:21 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-10-09 11:24:21 +0200 |
commit | a01b14f301afe9cea86f47b3ab27ce999097741a (patch) | |
tree | 6717762cc85090ec6aecc99cc052c82039debcbe /src/vehicles | |
parent | Fix POSIX streaming (diff) | |
download | re3-a01b14f301afe9cea86f47b3ab27ce999097741a.tar re3-a01b14f301afe9cea86f47b3ab27ce999097741a.tar.gz re3-a01b14f301afe9cea86f47b3ab27ce999097741a.tar.bz2 re3-a01b14f301afe9cea86f47b3ab27ce999097741a.tar.lz re3-a01b14f301afe9cea86f47b3ab27ce999097741a.tar.xz re3-a01b14f301afe9cea86f47b3ab27ce999097741a.tar.zst re3-a01b14f301afe9cea86f47b3ab27ce999097741a.zip |
Diffstat (limited to 'src/vehicles')
-rw-r--r-- | src/vehicles/Heli.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp index a770f83d..2c2fb33c 100644 --- a/src/vehicles/Heli.cpp +++ b/src/vehicles/Heli.cpp @@ -1011,14 +1011,16 @@ CHeli::TestSniperCollision(CVector *line0, CVector *line1) bool hit = false; for(i = 0; i < NUM_HELIS; i++){ - CVector pilotPos = pHelis[i]->GetMatrix() * CVector(-0.43f, 1.49f, 1.5f); - if(pHelis[i] && !pHelis[i]->bBulletProof && CCollision::DistToLine(line0, line1, &pilotPos) < 0.8f){ - pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f; - pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN; - pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 9999999; - pHelis[i]->m_numSwat = 0; + if(pHelis[i] && !pHelis[i]->bBulletProof) { + CVector pilotPos = pHelis[i]->GetMatrix() * CVector(-0.43f, 1.49f, 1.5f); + if(CCollision::DistToLine(line0, line1, &pilotPos) < 0.8f){ + pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f; + pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN; + pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 9999999; + pHelis[i]->m_numSwat = 0; - hit = true; + hit = true; + } } } return hit; |