Fix #4922 by enforcing the bounds

Testing with high reduce-turn-max, skidding looks fine with steer values that would have previously gone out of boundaries. No further fix is needed.
This commit is contained in:
Alayan 2023-11-11 01:40:04 +01:00
parent f4fd914858
commit 0eb64d0ad5
No known key found for this signature in database

View File

@ -210,6 +210,13 @@ float Skidding::updateSteering(float steer, int ticks)
} // switch m_skid_state } // switch m_skid_state
// A visual rotation outside of [-1, 1] bounds leads to severe graphical errors
// This allows the "reduce-turn-max" parameter for skidding to be set arbitrarily.
if (m_visual_rotation > 1.0f)
m_visual_rotation = 1.0f;
if (m_visual_rotation < -1.0f)
m_visual_rotation = -1.0f;
return steer_result; return steer_result;
} // updateSteering } // updateSteering