summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-06-08 01:34:53 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-06-08 01:34:53 +0200
commit2de3c6d67bc0a30edd9ec5b4dd089a48bc19cb5d (patch)
tree392a4583e8552dc891477ec45c5efd4e5c4a7fcf /src
parentMerge remote-tracking branch 'upstream/miami' into miami (diff)
downloadre3-2de3c6d67bc0a30edd9ec5b4dd089a48bc19cb5d.tar
re3-2de3c6d67bc0a30edd9ec5b4dd089a48bc19cb5d.tar.gz
re3-2de3c6d67bc0a30edd9ec5b4dd089a48bc19cb5d.tar.bz2
re3-2de3c6d67bc0a30edd9ec5b4dd089a48bc19cb5d.tar.lz
re3-2de3c6d67bc0a30edd9ec5b4dd089a48bc19cb5d.tar.xz
re3-2de3c6d67bc0a30edd9ec5b4dd089a48bc19cb5d.tar.zst
re3-2de3c6d67bc0a30edd9ec5b4dd089a48bc19cb5d.zip
Diffstat (limited to '')
-rw-r--r--src/control/CarCtrl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 38a242b4..1ad57392 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -2690,7 +2690,7 @@ void CCarCtrl::SteerAIHeliTowardsTargetCoors(CAutomobile* pHeli)
if (Abs(ZSpeedChangeTarget) < ZSpeedChangeMax)
pHeli->SetMoveSpeed(pHeli->GetMoveSpeed().x, pHeli->GetMoveSpeed().y, ZSpeedTarget);
else if (ZSpeedChangeTarget < 0.0f)
- pHeli->AddToMoveSpeed(0.0f, 0.0f, 1.5f * ZSpeedChangeMax);
+ pHeli->AddToMoveSpeed(0.0f, 0.0f, -1.5f * ZSpeedChangeMax);
else
pHeli->AddToMoveSpeed(0.0f, 0.0f, ZSpeedChangeMax);
}
@@ -2715,6 +2715,13 @@ void CCarCtrl::SteerAIHeliTowardsTargetCoors(CAutomobile* pHeli)
ZTurnSpeedTarget = -0.03f;
}
float ZTurnSpeedChangeTarget = ZTurnSpeedTarget - pHeli->GetTurnSpeed().z;
+ float ZTurnSpeedLimit = 0.0002f * CTimer::GetTimeStep();
+ if (Abs(ZTurnSpeedChangeTarget) < ZTurnSpeedLimit)
+ pHeli->m_vecTurnSpeed.z = ZTurnSpeedTarget;
+ else if (ZTurnSpeedChangeTarget < 0.0f)
+ pHeli->m_vecTurnSpeed.z -= ZTurnSpeedLimit;
+ else
+ pHeli->m_vecTurnSpeed.z += ZTurnSpeedLimit;
pHeli->m_fOrientation += pHeli->GetTurnSpeed().z * CTimer::GetTimeStep();
CVector up;
if (pHeli->bHeliMinimumTilt)