From 44b642ffa38bdc851a3d805e8751deb9f7e2eb55 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Mon, 10 Apr 2023 22:39:17 -0700 Subject: [PATCH] WIP: improved countersteering --- src/k_kart.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index c06b15bd7..5fcaa2ca1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -8854,10 +8854,17 @@ INT16 K_UpdateSteeringValue(INT16 inputSteering, INT16 destSteering) // player->steering is the turning value, but with easing applied. // Keeps micro-turning from old easing, but isn't controller dependent. - const INT16 amount = KART_FULLTURN/3; + INT16 amount = KART_FULLTURN/3; INT16 diff = destSteering - inputSteering; INT16 outputSteering = inputSteering; + + if ((inputSteering > 0 && destSteering < inputSteering) || (inputSteering < 0 && destSteering > inputSteering)) + { + amount = KART_FULLTURN; + } + + if (abs(diff) <= amount) { // Reached the intended value, set instantly.