Ver Fonte

Merge pull request #474 from kwhatmough/next

Prevent build-up of aero downforce while game is paused.
Sean Paul Taylor há 13 anos atrás
pai
commit
62842f6902
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      gameplay/src/PhysicsVehicle.cpp

+ 5 - 1
gameplay/src/PhysicsVehicle.cpp

@@ -263,7 +263,11 @@ void PhysicsVehicle::update(float elapsedTime, float steering, float braking, fl
 {
     float v = getSpeedKph();
     MathUtil::smooth(&_speedSmoothed, v, elapsedTime, 0, 1200);
-    applyDownforce();
+    if (elapsedTime > 0)
+    {
+        // Avoid accumulation of downforce while paused (zero elapsedTime)
+        applyDownforce();
+    }
 
     // Adjust control inputs based on vehicle speed.
     steering = getSteering(v, steering);