From f20ae22d9b7f0fe76492eb3e6d0d1591c1f6a2d3 Mon Sep 17 00:00:00 2001 From: AJ Martinez Date: Sat, 30 Dec 2023 17:48:02 -0700 Subject: [PATCH] Fix unusual DI behavior for low-strength inputs --- src/k_kart.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 2eabcd809..7e62940ef 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -12985,7 +12985,6 @@ void K_HandleDirectionalInfluence(player_t *player) fixed_t diX, diY; fixed_t diLen; - fixed_t diMul; fixed_t dot, invDot; @@ -13027,6 +13026,9 @@ void K_HandleDirectionalInfluence(player_t *player) inputLen = KART_FULLTURN; } + // Shallow inputs = less angle change. + strength = FixedMul(strength, (inputLen * FRACUNIT) / KART_FULLTURN); + if (player->tumbleBounces > 0) { // Very strong DI for tumble. @@ -13040,11 +13042,10 @@ void K_HandleDirectionalInfluence(player_t *player) diLen = FixedHypot(diX, diY); // Normalize - diMul = (KART_FULLTURN * FRACUNIT) / inputLen; if (diLen > 0) { - diX = FixedMul(diMul, FixedDiv(diX, diLen)); - diY = FixedMul(diMul, FixedDiv(diY, diLen)); + diX = FixedDiv(diX, diLen); + diY = FixedDiv(diY, diLen); } // Now that we got the DI direction, we can