summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Heli.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-10-09 11:02:21 +0200
committereray orçunus <erayorcunus@gmail.com>2020-10-09 11:24:21 +0200
commita01b14f301afe9cea86f47b3ab27ce999097741a (patch)
tree6717762cc85090ec6aecc99cc052c82039debcbe /src/vehicles/Heli.cpp
parentFix POSIX streaming (diff)
downloadre3-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/Heli.cpp')
-rw-r--r--src/vehicles/Heli.cpp16
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;