From b01643e0436f7187042639fce646682e64aab33c Mon Sep 17 00:00:00 2001 From: toaster Date: Sat, 13 Oct 2018 23:38:16 +0100 Subject: [PATCH] Fix to itembar visual length problem --- src/k_kart.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 1414c238..fcf99f80 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -6151,9 +6151,10 @@ static void K_drawKartItem(void) // Extensible meter, currently only used for rocket sneaker... if (itembar && hudtrans) { - const INT32 barlength = (splitscreen > 1 ? 12 : 24); - const INT32 max = (itemtime*3); // timer's normal highest value - const INT32 length = min(barlength, (itembar * barlength) / max); + const INT32 barlength = (splitscreen > 1 ? 12 : 26); + const INT32 maxl = (itemtime*3) - barlength; // timer's normal highest value + const INT32 fill = ((itembar*barlength)/maxl); + const INT32 length = min(barlength, fill); const INT32 height = (offset ? 1 : 2); const INT32 x = (offset ? 17 : 11), y = (offset ? 27 : 35);