summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/vehicles/Automobile.cpp4
-rw-r--r--src/vehicles/HandlingMgr.cpp2
-rw-r--r--src/vehicles/Transmission.cpp2
-rw-r--r--src/vehicles/Vehicle.cpp4
4 files changed, 8 insertions, 4 deletions
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 79d3f6af..e66865da 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -216,6 +216,8 @@ CAutomobile::SetModelIndex(uint32 id)
CVector vecDAMAGE_ENGINE_POS_SMALL(-0.1f, -0.1f, 0.0f);
CVector vecDAMAGE_ENGINE_POS_BIG(-0.5f, -0.3f, 0.0f);
+#pragma optimize("", off) // that's what R* did
+
void
CAutomobile::ProcessControl(void)
{
@@ -1214,6 +1216,8 @@ CAutomobile::ProcessControl(void)
}
}
+#pragma optimize("", on)
+
void
CAutomobile::Teleport(CVector pos)
{
diff --git a/src/vehicles/HandlingMgr.cpp b/src/vehicles/HandlingMgr.cpp
index 3ac6f057..be8150fb 100644
--- a/src/vehicles/HandlingMgr.cpp
+++ b/src/vehicles/HandlingMgr.cpp
@@ -143,7 +143,7 @@ cHandlingDataMgr::LoadHandlingData(void)
case 11: handling->fTractionBias = strtod(word, nil); break;
case 12: handling->Transmission.nNumberOfGears = atoi(word); break;
case 13: handling->Transmission.fMaxVelocity = strtod(word, nil); break;
- case 14: handling->Transmission.fEngineAcceleration = strtod(word, nil) * 0.4f; break;
+ case 14: handling->Transmission.fEngineAcceleration = strtod(word, nil) * 0.4; break;
case 15: handling->Transmission.nDriveType = word[0]; break;
case 16: handling->Transmission.nEngineType = word[0]; break;
case 17: handling->fBrakeDeceleration = strtod(word, nil); break;
diff --git a/src/vehicles/Transmission.cpp b/src/vehicles/Transmission.cpp
index 5287055d..109847a5 100644
--- a/src/vehicles/Transmission.cpp
+++ b/src/vehicles/Transmission.cpp
@@ -128,7 +128,7 @@ cTransmission::CalculateDriveAcceleration(const float &gasPedal, uint8 &gear, fl
else
fCheat = 1.0f;
float targetVelocity = Gears[gear].fMaxVelocity*speedMul*fCheat;
- float accel = fEngineAcceleration*accelMul * (targetVelocity - fVelocity)/Abs(targetVelocity);
+ float accel = (targetVelocity - fVelocity) * (fEngineAcceleration*accelMul) / Abs(targetVelocity);
if(Abs(fVelocity) < Abs(Gears[gear].fMaxVelocity*fCheat))
fAcceleration = gasPedal * accel * CTimer::GetTimeStep();
else
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index ba9348f0..eba9c596 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -531,9 +531,9 @@ CVehicle::ProcessWheel(CVector &wheelFwd, CVector &wheelRight, CVector &wheelCon
if(!bBraking){
if(m_fGasPedal < 0.01f){
if(GetModelIndex() == MI_RCBANDIT)
- brake = 0.2f * mod_HandlingManager.fWheelFriction / m_fMass;
+ brake = 0.2f * mod_HandlingManager.fWheelFriction / pHandling->m_fMass;
else
- brake = mod_HandlingManager.fWheelFriction / m_fMass;
+ brake = mod_HandlingManager.fWheelFriction / pHandling->m_fMass;
#ifdef FIX_BUGS
brake *= CTimer::GetTimeStepFix();
#endif