display 4 digit ammo in inventory bar in quake hud
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Aug 2007 13:15:13 +0000 (13:15 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 9 Aug 2007 13:15:13 +0000 (13:15 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@7509 d7cf8633-e32d-0410-b094-e92efae38249

sbar.c

diff --git a/sbar.c b/sbar.c
index 39b03c0..bc14b38 100644 (file)
--- a/sbar.c
+++ b/sbar.c
@@ -863,12 +863,14 @@ void Sbar_DrawInventory (void)
        // ammo counts
        for (i=0 ; i<4 ; i++)
        {
-               sprintf (num, "%3i",cl.stats[STAT_SHELLS+i] );
+               sprintf (num, "%4i",cl.stats[STAT_SHELLS+i] );
                if (num[0] != ' ')
-                       Sbar_DrawCharacter ( (6*i+1)*8 - 2, -24, 18 + num[0] - '0');
+                       Sbar_DrawCharacter ( (6*i+0)*8 - 2, -24, 18 + num[0] - '0');
                if (num[1] != ' ')
-                       Sbar_DrawCharacter ( (6*i+2)*8 - 2, -24, 18 + num[1] - '0');
+                       Sbar_DrawCharacter ( (6*i+1)*8 - 2, -24, 18 + num[1] - '0');
                if (num[2] != ' ')
+                       Sbar_DrawCharacter ( (6*i+2)*8 - 2, -24, 18 + num[2] - '0');
+               if (num[3] != ' ')
                        Sbar_DrawCharacter ( (6*i+3)*8 - 2, -24, 18 + num[2] - '0');
        }