From 33ff42af1f2409687b2249c5b0c76e4840ac4e12 Mon Sep 17 00:00:00 2001 From: Ashnal Date: Thu, 30 Jan 2025 20:35:16 -0500 Subject: [PATCH] Fixed math oopsie --- src/k_kart.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f15e4f14f..a5bd3674a 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -15244,20 +15244,12 @@ UINT16 K_GetDisplayEXP(player_t *player) if (!numgradingpoints) return UINT16_MAX; - fixed_t result = max(player->exp, FRACUNIT/2); - result = FixedMul(result, (500/numgradingpoints)*player->gradingpointnum); + // target is where you should be if you're doing good and at a 1.0 mult + fixed_t clampedexp = max(FRACUNIT/2, min(FRACUNIT*7/5, player->exp)); // clamp between 0.5 and 1.4 + fixed_t targetdisplayexp = (500*player->gradingpointnum/numgradingpoints)<>FRACBITS; - // bro where is. bro where is std::clamp - if (result < 0) - { - result = 0; - } - else if (result > 999) - { - result = 999; - } - - return result; + return displayexp; } UINT32 K_GetNumGradingPoints(void)