diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2020-06-08 00:16:21 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2020-06-08 00:16:21 +0200 |
commit | af564d865c3883f11a5272be76f3a51863586a8d (patch) | |
tree | 24a2c4d90909c20c34eb9e666818df6b011189dd | |
parent | fixed some arithmetic (diff) | |
download | re3-af564d865c3883f11a5272be76f3a51863586a8d.tar re3-af564d865c3883f11a5272be76f3a51863586a8d.tar.gz re3-af564d865c3883f11a5272be76f3a51863586a8d.tar.bz2 re3-af564d865c3883f11a5272be76f3a51863586a8d.tar.lz re3-af564d865c3883f11a5272be76f3a51863586a8d.tar.xz re3-af564d865c3883f11a5272be76f3a51863586a8d.tar.zst re3-af564d865c3883f11a5272be76f3a51863586a8d.zip |
-rw-r--r-- | src/control/CarCtrl.cpp | 12 | ||||
-rw-r--r-- | src/control/Script.cpp | 4 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index e8b3bfd9..5db674cd 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -984,13 +984,15 @@ void CCarCtrl::SlowCarDownForPedsSectorList(CPtrList& lst, CVehicle* pVehicle, f if (pVehicle->GetModelIndex() == MI_RCBANDIT){ if (dotVelocity * GAME_SPEED_TO_METERS_PER_SECOND / 2 > distanceUntilHit) pPed->SetEvasiveStep(pVehicle, 0); - }else if (dotVelocity > 0.3f){ - if (sideLength - 0.5f < sidewaysDistance) + } + else if (dotVelocity > 0.3f) { + if (sideLength + 0.1f < sidewaysDistance) pPed->SetEvasiveStep(pVehicle, 0); else pPed->SetEvasiveDive(pVehicle, 0); - }else{ - if (sideLength + 0.1f < sidewaysDistance) + } + else if (dotVelocity > 0.1f) { + if (sideLength - 0.5f < sidewaysDistance) pPed->SetEvasiveStep(pVehicle, 0); else pPed->SetEvasiveDive(pVehicle, 0); @@ -1019,7 +1021,7 @@ void CCarCtrl::SlowCarDownForPedsSectorList(CPtrList& lst, CVehicle* pVehicle, f CPlayerPed* pPlayerPed = (CPlayerPed*)pPed; if (pPlayerPed->IsPlayer() && dotDirection < frontSafe && pPlayerPed->IsPedInControl() && - pPlayerPed->m_fMoveSpeed < 0.1f && pPlayerPed->bIsLooking && + pPlayerPed->m_fMoveSpeed < 1.0f && !pPlayerPed->bIsLooking && CTimer::GetTimeInMilliseconds() > pPlayerPed->m_lookTimer) { pPlayerPed->AnnoyPlayerPed(false); pPlayerPed->SetLookFlag(pVehicle, true); diff --git a/src/control/Script.cpp b/src/control/Script.cpp index d90f2a0b..da321a28 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -2153,7 +2153,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command) car->AutoPilot.m_nCarMission = MISSION_GOTOCOORDS; car->SetStatus(STATUS_PHYSICS); car->bEngineOn = true; - car->AutoPilot.m_nCruiseSpeed = Max(car->AutoPilot.m_nCruiseSpeed, 6); + car->AutoPilot.m_nCruiseSpeed = Max(6, car->AutoPilot.m_nCruiseSpeed); car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds(); return 0; } @@ -2165,7 +2165,7 @@ int8 CRunningScript::ProcessCommands100To199(int32 command) CCarCtrl::JoinCarWithRoadSystem(car); car->AutoPilot.m_nCarMission = MISSION_CRUISE; car->bEngineOn = true; - car->AutoPilot.m_nCruiseSpeed = Max(car->AutoPilot.m_nCruiseSpeed, 6); + car->AutoPilot.m_nCruiseSpeed = Max(6, car->AutoPilot.m_nCruiseSpeed); car->AutoPilot.m_nAntiReverseTimer = CTimer::GetTimeInMilliseconds(); return 0; } |