]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sbar.c
display 4 digit ammo in inventory bar in quake hud
[xonotic/darkplaces.git] / sbar.c
diff --git a/sbar.c b/sbar.c
index 33a39dcb81bfbfc6e4726a840ff6e74e4a9fc3e1..bc14b3842448f95bcaac046cd31c42d0e6a5dfa8 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');
        }
 
@@ -1223,9 +1225,9 @@ void Sbar_Draw (void)
                                else
                                {
                                        if (redflag)
-                                               Sbar_DrawPic (10 - sbar_x, -109, sb_items[redflag+10]);
+                                               Sbar_DrawPic (10 - sbar_x, -117, sb_items[redflag+10]);
                                        if (blueflag)
-                                               Sbar_DrawPic (10 - sbar_x, -169, sb_items[blueflag+14]);
+                                               Sbar_DrawPic (10 - sbar_x, -177, sb_items[blueflag+14]);
                                }
 
                                // armor
@@ -1318,9 +1320,9 @@ void Sbar_Draw (void)
                                else
                                {
                                        if (redflag)
-                                               Sbar_DrawPic (10 - sbar_x, -109, sb_items[redflag+10]);
+                                               Sbar_DrawPic (10 - sbar_x, -117, sb_items[redflag+10]);
                                        if (blueflag)
-                                               Sbar_DrawPic (10 - sbar_x, -169, sb_items[blueflag+14]);
+                                               Sbar_DrawPic (10 - sbar_x, -177, sb_items[blueflag+14]);
                                }
 
                                // armor
@@ -1542,16 +1544,15 @@ void Sbar_Draw (void)
 
                                Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10);
 
-                       }
-
-                       // LordHavoc: changed to draw the deathmatch overlays in any multiplayer mode
-                       if ((!cl.islocalgame || cl.gametype != GAME_COOP))
-                       {
-                               if (gamemode == GAME_TRANSFUSION)
-                                       Sbar_MiniDeathmatchOverlay (0, 0);
-                               else
-                                       Sbar_MiniDeathmatchOverlay (sbar_x + 324, vid_conheight.integer - 8*8);
-                               Sbar_Score(24);
+                               // LordHavoc: changed to draw the deathmatch overlays in any multiplayer mode
+                               if ((!cl.islocalgame || cl.gametype != GAME_COOP))
+                               {
+                                       if (gamemode == GAME_TRANSFUSION)
+                                               Sbar_MiniDeathmatchOverlay (0, 0);
+                                       else
+                                               Sbar_MiniDeathmatchOverlay (sbar_x + 324, vid_conheight.integer - 8*8);
+                                       Sbar_Score(24);
+                               }
                        }
                }
        }