From 8735e24d9984dc8e42052588d036627e9f4d65ad Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 21 Nov 2022 10:01:44 +0100 Subject: [PATCH] - don't print negative ammo numbers on the Duke HUD. --- wadsrc/static/zscript/games/duke/ui/sbar_d.zs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/wadsrc/static/zscript/games/duke/ui/sbar_d.zs b/wadsrc/static/zscript/games/duke/ui/sbar_d.zs index 8ae7a054f..f87a56fc1 100644 --- a/wadsrc/static/zscript/games/duke/ui/sbar_d.zs +++ b/wadsrc/static/zscript/games/duke/ui/sbar_d.zs @@ -337,16 +337,18 @@ class DukeStatusBar : DukeCommonStatusBar String format; bool parsedDivisor = false; + num1 = max(num1, 0); + num2 = max(num2, 0); if (numdigits == 2) { - if (num1 > 99) num1 = 99; - if (num2 > 99) num2 = 99; + num1 = min(num1, 99); + num2 = min(num2, 99); format = String.Format("%2d/%d", num1, num2); } else { - if (num1 > 999) num1 = 999; - if (num2 > 999) num2 = 999; + num1 = min(num1, 999); + num2 = min(num2, 999); format = String.Format("%3d/%d", num1, num2); } y--;