]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Do it in a better way. The server only sends the health of eaten players. So instead...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 11:25:55 +0000 (14:25 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 11:25:55 +0000 (14:25 +0300)
data/qcsrc/client/sbar.qc

index 6cc7ec2adf94ba003a05046e79f379d64a119a1f..c65579a5944aa5512d25852094a3cc2e95aeee69 100644 (file)
@@ -947,7 +947,7 @@ void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_num
 }\r
 \r
 float fieldcounter;\r
-void Sbar_PrintStomachboardItem(vector pos, entity pl, float showhealth)\r
+void Sbar_PrintStomachboardItem(vector pos, entity pl)\r
 {\r
        vector tmp, rgb;\r
        rgb = GetTeamRGB(pl.team);\r
@@ -977,8 +977,8 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl, float showhealth)
                        drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
                }\r
 \r
-               if(showhealth)\r
-               if(field == ST_HEALTH) {\r
+               if(field == ST_HEALTH)\r
+               if(stof(str)) { // only if player health is not 0\r
                        pos_x += 138;\r
                        if(g_vore_showpreyhealth)\r
                                drawpic(pos, "gfx/hud/sb_health", '11 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
@@ -2924,13 +2924,13 @@ void Sbar_Draw (void)
 \r
                        if(f)\r
                        {\r
-                               Sbar_PrintStomachboardItem(pos - '-16 124 0', pl, TRUE);\r
+                               Sbar_PrintStomachboardItem(pos - '-16 124 0', pl);\r
                                pos_y += 1.25 * sbar_fontsize_y;\r
                        }\r
 \r
                        if(getstati(STAT_STOMACH_EATEN))\r
                        if(pl.sv_entnum == getstati(STAT_STOMACH_EATEN) - 1)\r
-                               Sbar_PrintStomachboardItem(pos - '-76 156 0', pl, FALSE);\r
+                               Sbar_PrintStomachboardItem(pos - '-76 156 0', pl);\r
                }\r
 \r
                if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r