summaryrefslogtreecommitdiff
path: root/src/control
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-12-12 20:35:17 +0300
committerNikolay Korolev <nickvnuk@gmail.com>2020-12-12 20:35:17 +0300
commit82c40b73ca4a4e67e0e53a34caac546f012fe54d (patch)
treeba1b4e2a262a825b475ed3fa2ab82c01a581333e /src/control
parent3038fba9ca6b2fcb3a4f95543db624fe81deb392 (diff)
fixed a bug
Diffstat (limited to 'src/control')
-rw-r--r--src/control/CarCtrl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 520efe75..cb4229eb 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -2338,7 +2338,11 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
switch (pVehicle->AutoPilot.m_nDrivingStyle) {
case DRIVINGSTYLE_STOP_FOR_CARS:
case DRIVINGSTYLE_SLOW_DOWN_FOR_CARS:
- speedStyleMultiplier = FindMaximumSpeedForThisCarInTraffic(pVehicle) / pVehicle->AutoPilot.m_nCruiseSpeed;
+ speedStyleMultiplier = FindMaximumSpeedForThisCarInTraffic(pVehicle);
+#ifdef FIX_BUGS
+ if (pVehicle->AutoPilot.m_nCruiseSpeed != 0)
+#endif
+ speedStyleMultiplier /= pVehicle->AutoPilot.m_nCruiseSpeed;
break;
default:
speedStyleMultiplier = 1.0f;