From 30f9ec5fd857edfb641a7bc88d722570d9f98082 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Wed, 15 Mar 2023 21:30:44 +1100 Subject: [PATCH] - Blood: Fix shotgun ammo display when player fires a shell, switches weapons, then switches back. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Such a circumstance reloads the weapon off screen. * While the "right" fix would be to stop that, some fanatics will probably be relying on such a mechanism. * As such, just fudge the printout on the screen instead 🙃. * Fixes #877. --- wadsrc/static/zscript/games/blood/ui/sbar.zs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wadsrc/static/zscript/games/blood/ui/sbar.zs b/wadsrc/static/zscript/games/blood/ui/sbar.zs index bb31ca484..c4af37a27 100644 --- a/wadsrc/static/zscript/games/blood/ui/sbar.zs +++ b/wadsrc/static/zscript/games/blood/ui/sbar.zs @@ -688,6 +688,9 @@ class BloodStatusBar : RazeStatusBar } else { + bool stateNeedsEvenAmt = pPlayer.weaponState == 3 || pPlayer.weaponState == 1; + bool stateNeedsOddAmt = pPlayer.weaponState == 2; + num += stateNeedsEvenAmt && (num % 2) || stateNeedsOddAmt && !(num % 2); int clip = CalcMagazineAmount(num, 2, pPlayer.weaponState == 1); int total = num - clip; String format = String.Format("%d/%d", clip, num - clip);