]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Use another function to print the predator name. We can undo the 0 health hiding...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 12:28:58 +0000 (15:28 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 12:28:58 +0000 (15:28 +0300)
data/qcsrc/client/sbar.qc

index 46b8823375a5bb0047fa69580a3275005cda6851..c03ac7138a0667d36e3509368bfd07a8e035c693 100644 (file)
@@ -949,16 +949,9 @@ void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self, float pl_num
 float fieldcounter;\r
 void Sbar_PrintStomachboardItem(vector pos, entity pl)\r
 {\r
-       vector tmp, rgb;\r
-       rgb = GetTeamRGB(pl.team);\r
        string str;\r
        float f, field;\r
 \r
-       // Layout:\r
-       tmp_x = sbwidth;\r
-       tmp_y = sbar_fontsize_y * 1.25;\r
-       tmp_z = 0;\r
-\r
        for(fieldcounter = 1; fieldcounter <= 2; ++fieldcounter)\r
        {\r
                field = -fieldcounter;\r
@@ -978,7 +971,7 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
                }\r
 \r
                if(field == ST_HEALTH)\r
-               if(g_vore_showpreyhealth && stof(str)) { // only if player health is not 0\r
+               if(g_vore_showpreyhealth) {\r
                        pos_x += 138;\r
                                if(pl.sv_entnum == player_localentnum - 1 || (spectatee_status && pl.sv_entnum == spectatee_status - 1))\r
                                        drawcolorcodedstring(pos, " me", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
@@ -993,6 +986,31 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
        }\r
 }\r
 \r
+void Sbar_PrintStomachboardItemPred(vector pos, entity pl)\r
+{\r
+       string str;\r
+       float f, field;\r
+\r
+       for(fieldcounter = 1; fieldcounter <= 2; ++fieldcounter)\r
+       {\r
+               field = -fieldcounter;\r
+               if(field == SP_SEPARATOR)\r
+                       break;\r
+\r
+               str = Sbar_GetStomachField(pl, field);\r
+\r
+               if(field == ST_NAME) {\r
+                       f = stof(getplayerkey(pl.sv_entnum, "colors"));\r
+                       drawpic(pos, "gfx/sb_playercolor_base", '22 11 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, "gfx/sb_playercolor_shirt", '22 11 0', colormapPaletteColor(floor(f / 16), 0), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+                       drawpic(pos, "gfx/sb_playercolor_pants", '22 11 0', colormapPaletteColor(mod(f, 16), 1), sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+\r
+                       pos_x += 24;\r
+                       drawcolorcodedstring(pos, str, '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+               }\r
+       }\r
+}\r
+\r
 /*\r
  * Sbar_Scoreboard_MakeTable\r
  *\r
@@ -2933,7 +2951,7 @@ void Sbar_Draw (void)
 \r
                        if(getstati(STAT_STOMACH_EATEN))\r
                        if(pl.sv_entnum == getstati(STAT_STOMACH_EATEN) - 1)\r
-                               Sbar_PrintStomachboardItem(pos - '-76 156 0', pl);\r
+                               Sbar_PrintStomachboardItemPred(pos - '-76 156 0', pl);\r
                }\r
 \r
                if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r