From 942718a44268c5c85ca1609c7420070aa0875a12 Mon Sep 17 00:00:00 2001
From: hiker <henrichsjoerg@gmail.com>
Date: Fri, 17 Aug 2018 17:46:27 +1000
Subject: [PATCH] Fixed physics differences based on setting the restitution in
 case of a rewind based on the wrong (old) speed.

---
 src/karts/kart.cpp | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp
index d94add348..d076d31a8 100644
--- a/src/karts/kart.cpp
+++ b/src/karts/kart.cpp
@@ -1275,13 +1275,6 @@ void Kart::update(int ticks)
 {
     m_powerup->update(ticks);
 
-    // Make the restitution depend on speed: this avoids collision issues,
-    // otherwise a collision with high speed can see a kart being push
-    // high up in the air (and out of control). So for higher speed we
-    // reduce the restitution, meaning the karts will get less of a push
-    // based on the collision speed.
-    m_body->setRestitution(m_kart_properties->getRestitution(fabsf(m_speed)));
-
     // Reset any instand speed increase in the bullet kart
     m_vehicle->setMinSpeed(0);
 
@@ -1332,6 +1325,12 @@ void Kart::update(int ticks)
     // Update the locally maintained speed of the kart (m_speed), which 
     // is used furthermore for engine power, camera distance etc
     updateSpeed();
+    // Make the restitution depend on speed: this avoids collision issues,
+    // otherwise a collision with high speed can see a kart being push
+    // high up in the air (and out of control). So for higher speed we
+    // reduce the restitution, meaning the karts will get less of a push
+    // based on the collision speed.
+    m_body->setRestitution(m_kart_properties->getRestitution(fabsf(m_speed)));
 
     m_controller->update(ticks);