]> de.git.xonotic.org Git - voretournament/voretournament.git/commitdiff
Put the eater name in a different function
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 23:42:05 +0000 (02:42 +0300)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 4 Sep 2010 23:42:05 +0000 (02:42 +0300)
data/qcsrc/client/sbar.qc

index f5a1a5075049936b79d2fb7313cfe3f55fc006f9..a0ed0ab2f9ee83bccdcba87b9609eb2284f92ef3 100644 (file)
@@ -949,6 +949,8 @@ 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
+       // list the players in the stomach\r
+\r
        string str;\r
        float f, field;\r
 \r
@@ -979,7 +981,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. Also used to hide the predators health\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, "self", '11 11 0', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
@@ -994,6 +996,34 @@ void Sbar_PrintStomachboardItem(vector pos, entity pl)
        }\r
 }\r
 \r
+float fieldcounter2;\r
+void Sbar_PrintStomachboardItem2(vector pos, entity pl)\r
+{\r
+       // show the name of our eater\r
+\r
+       string str;\r
+       float f, field;\r
+\r
+       for(fieldcounter2 = 1; fieldcounter2 <= 2; ++fieldcounter2)\r
+       {\r
+               field = -fieldcounter2;\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
@@ -2979,7 +3009,7 @@ void Sbar_Draw (void)
 \r
                        if(getstati(STAT_STOMACH_EATEN))\r
                        if(pl.sv_entnum == getstati(STAT_STOMACH_EATEN) - 1)\r
-                               Sbar_PrintStomachboardItem(bottomleft - '-76 156 0', pl);\r
+                               Sbar_PrintStomachboardItem2(bottomleft - '-76 156 0', pl);\r
                }\r
 \r
                if (cvar("viewsize") <= 100 && vid_conwidth <= 1600) {\r