]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/scoreboard.qc
Require semicolon or definition following `METHOD`
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / scoreboard.qc
index ebc0db3502984b37221bc0b0bc685ec339eaf0e5..b6d2db25c2e90086e9ba9dedf7f410f52382d629 100644 (file)
@@ -1,22 +1,15 @@
-#if defined(CSQC)
-       #include "../dpdefs/csprogsdefs.qh"
-       #include "defs.qh"
-       #include "../common/constants.qh"
-       #include "../common/stats.qh"
-       #include "../common/teams.qh"
-       #include "../common/util.qh"
-       #include "../common/buffs.qh"
-       #include "../common/counting.qh"
-       #include "../common/weapons/weapons.qh"
-       #include "../common/mapinfo.qh"
-       #include "command/cl_cmd.qh"
-       #include "autocvars.qh"
-       #include "hud.qh"
-       #include "scoreboard.qh"
-       #include "main.qh"
-#elif defined(MENUQC)
-#elif defined(SVQC)
-#endif
+#include "scoreboard.qh"
+#include "_all.qh"
+
+#include "hud.qh"
+#include "sortlist.qh"
+
+#include "../common/constants.qh"
+#include "../common/counting.qh"
+#include "../common/mapinfo.qh"
+#include "../common/stats.qh"
+#include "../common/teams.qh"
+#include "../common/util.qh"
 
 float scoreboard_alpha_bg;
 float scoreboard_alpha_fg;
@@ -74,7 +67,6 @@ string TranslateScoresLabel(string l)
        }
 }
 
-void Cmd_HUD_SetFields(float argc);
 void HUD_InitScores()
 {
        int i, f;
@@ -105,7 +97,6 @@ void HUD_InitScores()
        Cmd_HUD_SetFields(0);
 }
 
-void HUD_UpdatePlayerPos(entity pl);
 float SetTeam(entity pl, float Team);
 //float lastpnum;
 void HUD_UpdatePlayerTeams()
@@ -369,7 +360,6 @@ void Cmd_HUD_SetFields(float argc)
 
        hud_fontsize = HUD_GetFontsize("hud_fontsize");
 
-       draw_beginBoldFont();
        for(i = 1; i < argc - 1; ++i)
        {
                float nocomplain;
@@ -508,7 +498,6 @@ void Cmd_HUD_SetFields(float argc)
        }
 
        hud_field[hud_num_fields] = SP_END;
-       draw_endBoldFont();
 }
 
 // MOVEUP::
@@ -524,7 +513,8 @@ float hud_field_icon1_alpha;
 float hud_field_icon2_alpha;
 string HUD_GetField(entity pl, int field)
 {
-       float tmp, num, denom, f;
+       float tmp, num, denom;
+       int f;
        string str;
        hud_field_rgb = '1 1 1';
        hud_field_icon0 = "";
@@ -627,7 +617,6 @@ string HUD_GetField(entity pl, int field)
        //return "error";
 }
 
-float xmin, xmax, ymin, ymax, sbwidth;
 float hud_fixscoreboardcolumnwidth_len;
 float hud_fixscoreboardcolumnwidth_iconlen;
 float hud_fixscoreboardcolumnwidth_marginlen;
@@ -703,14 +692,14 @@ void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_s
        vector tmp, rgb;
        rgb = Team_ColorRGB(pl.team);
        string str;
-       float field;
+       int field;
        float is_spec;
        is_spec = (GetPlayerColor(pl.sv_entnum) == NUM_SPECTATOR);
 
        if((rgb == '1 1 1') && (!is_spec)) {
-               rgb_x = autocvar_scoreboard_color_bg_r + 0.5;
-               rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
-               rgb_z = autocvar_scoreboard_color_bg_b + 0.5; }
+               rgb.x = autocvar_scoreboard_color_bg_r + 0.5;
+               rgb.y = autocvar_scoreboard_color_bg_g + 0.5;
+               rgb.z = autocvar_scoreboard_color_bg_b + 0.5; }
 
        vector h_pos = pos - '1 1 0';
        vector h_size = item_size + '2 0 0';
@@ -720,9 +709,9 @@ void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_s
        else if((scoreboard_highlight) && (!(pl_number % 2)))
                drawfill(h_pos, h_size, rgb, scoreboard_highlight_alpha, DRAWFLAG_NORMAL);
 
-       tmp_x = item_size.x;
-       tmp_y = 0;
-       tmp_z = 0;
+       tmp.x = item_size.x;
+       tmp.y = 0;
+       tmp.z = 0;
        int i;
        for(i = 0; i < hud_num_fields; ++i)
        {
@@ -740,20 +729,20 @@ void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_s
                pos.x += hud_size[i] + hud_fontsize.x;
 
                if(field == SP_NAME) {
-                       tmp_x = hud_size[i] - hud_fontsize.x*hud_fixscoreboardcolumnwidth_iconlen - hud_fixscoreboardcolumnwidth_marginlen + hud_fontsize.x;
+                       tmp.x = hud_size[i] - hud_fontsize.x*hud_fixscoreboardcolumnwidth_iconlen - hud_fixscoreboardcolumnwidth_marginlen + hud_fontsize.x;
                        if (is_self)
                                drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
                        else
                                drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name, DRAWFLAG_NORMAL);
                } else {
-                       tmp_x = hud_fixscoreboardcolumnwidth_len + hud_fontsize.x;
+                       tmp.x = hud_fixscoreboardcolumnwidth_len + hud_fontsize.x;
                        if (is_self)
                                drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
                        else
                                drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name, DRAWFLAG_NORMAL);
                }
 
-               tmp_x = hud_size[i] + hud_fontsize.x;
+               tmp.x = hud_size[i] + hud_fontsize.x;
                if(hud_field_icon0 != "")
                        if (is_self)
                                drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
@@ -773,7 +762,7 @@ void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_s
 
        if(hud_field[i] == SP_SEPARATOR)
        {
-               pos_x = xmax;
+               pos.x = xmax;
                for(i = hud_num_fields-1; i > 0; --i)
                {
                        field = hud_field[i];
@@ -789,20 +778,20 @@ void HUD_PrintScoreboardItem(vector pos, vector item_size, entity pl, float is_s
                        str = HUD_FixScoreboardColumnWidth(i, str);
 
                        if(field == SP_NAME) {
-                               tmp_x = hud_fixscoreboardcolumnwidth_len; // left or right aligned? let's put it right...
+                               tmp.x = hud_fixscoreboardcolumnwidth_len; // left or right aligned? let's put it right...
                                if(is_self)
                                        drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
                                else
                                        drawcolorcodedstring(pos - tmp, str, hud_fontsize, scoreboard_alpha_name, DRAWFLAG_NORMAL);
                        } else {
-                               tmp_x = hud_fixscoreboardcolumnwidth_len;
+                               tmp.x = hud_fixscoreboardcolumnwidth_len;
                                if(is_self)
                                        drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
                                else
                                        drawstring(pos - tmp, str, hud_fontsize, hud_field_rgb, scoreboard_alpha_name, DRAWFLAG_NORMAL);
                        }
 
-                       tmp_x = hud_size[i];
+                       tmp.x = hud_size[i];
                        if(hud_field_icon0 != "")
                                if (is_self)
                                        drawpic(pos - tmp, hud_field_icon0, '0 1 0' * hud_fontsize.y + '1 0 0' * hud_fontsize.x * hud_fixscoreboardcolumnwidth_iconlen, hud_field_icon1_rgb, hud_field_icon0_alpha * scoreboard_alpha_name_self, DRAWFLAG_NORMAL);
@@ -843,8 +832,8 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
        pos.y += autocvar_scoreboard_border_thickness;
        pos -= '1 1 0';
 
-       tmp_x = sbwidth + 2;
-       tmp_y = 1.25 * hud_fontsize.y;
+       tmp.x = sbwidth + 2;
+       tmp.y = 1.25 * hud_fontsize.y;
 
        // rounded header
        if (teamplay)
@@ -859,13 +848,13 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
 
        // separator header/table
        pos.y += 1.25 * hud_fontsize.y;
-       tmp_y = autocvar_scoreboard_border_thickness;
+       tmp.y = autocvar_scoreboard_border_thickness;
        drawfill(pos, tmp, '0 0 0', scoreboard_alpha_bg, DRAWFLAG_NORMAL);
 
        pos.y += autocvar_scoreboard_border_thickness;
 
        // table background
-       tmp_y = body_table_height;
+       tmp.y = body_table_height;
        if (teamplay)
                drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
        else
@@ -882,19 +871,18 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
 
        if (scoreboard_highlight)
        {
-               column_dim_y = 1.25 * hud_fontsize.y; // header
+               column_dim.y = 1.25 * hud_fontsize.y; // header
                column_dim.y += autocvar_scoreboard_border_thickness;
                column_dim.y += body_table_height;
        }
 
        // print the strings of the columns headers and draw the columns
-       draw_beginBoldFont();
        int i;
        for(i = 0; i < hud_num_fields; ++i)
        {
                if(hud_field[i] == SP_SEPARATOR)
                        break;
-               column_dim_x = hud_size[i] + hud_fontsize.x;
+               column_dim.x = hud_size[i] + hud_fontsize.x;
                if (scoreboard_highlight)
                {
                        if (i % 2)
@@ -905,8 +893,8 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
        }
        if(hud_field[i] == SP_SEPARATOR)
        {
-               pos_x = xmax;
-               tmp_y = 0;
+               pos.x = xmax;
+               tmp.y = 0;
                for(i = hud_num_fields-1; i > 0; --i)
                {
                        if(hud_field[i] == SP_SEPARATOR)
@@ -919,28 +907,27 @@ vector HUD_Scoreboard_MakeTable(vector pos, entity tm, vector rgb, vector bg_siz
                                if (!(i % 2))
                                {
                                        if (i == hud_num_fields-1)
-                                               column_dim_x = hud_size[i] + hud_fontsize.x / 2 + 1;
+                                               column_dim.x = hud_size[i] + hud_fontsize.x / 2 + 1;
                                        else
-                                               column_dim_x = hud_size[i] + hud_fontsize.x;
+                                               column_dim.x = hud_size[i] + hud_fontsize.x;
                                        drawfill(pos - '0 1 0' - hud_fontsize.x / 2 * '1 0 0', column_dim, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
                                }
                        }
 
-                       tmp_x = stringwidth(hud_title[i], false, hud_fontsize);
-                       tmp_x = (hud_size[i] - tmp.x);
+                       tmp.x = stringwidth(hud_title[i], false, hud_fontsize);
+                       tmp.x = (hud_size[i] - tmp.x);
                        drawstring(pos + tmp, hud_title[i], hud_fontsize, rgb * 1.5, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
                        pos.x -= hud_fontsize.x;
                }
        }
-       draw_endBoldFont();
 
-       pos_x = xmin;
+       pos.x = xmin;
        pos.y += 1.25 * hud_fontsize.y; // skip the header
        pos.y += autocvar_scoreboard_border_thickness;
 
        // item size
-       tmp_x = sbwidth;
-       tmp_y = hud_fontsize.y * 1.25;
+       tmp.x = sbwidth;
+       tmp.y = hud_fontsize.y * 1.25;
 
        // fill the table and draw the rows
        i = 0;
@@ -989,24 +976,46 @@ float HUD_WouldDrawScoreboard() {
 float average_accuracy;
 vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
 {
+       WepSet weapons_stat = WepSet_GetFromStat();
+       WepSet weapons_inmap = WepSet_GetFromStat_InMap();
+       float initial_posx = pos.x;
        int i;
-       float weapon_cnt = WEP_COUNT - 3; // either vaporizer/vortex are hidden, no port-o-launch, no tuba
-       float rows;
-       if(autocvar_scoreboard_accuracy_doublerows)
+       float weapon_stats;
+       int disownedcnt = 0;
+       for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+       {
+               self = get_weaponinfo(i);
+               if(!self.weapon)
+                       continue;
+
+               weapon_stats = weapon_accuracy[i-WEP_FIRST];
+
+               if(weapon_stats < 0 && !(weapons_stat & WepSet_FromWeapon(i) || weapons_inmap & WepSet_FromWeapon(i)))
+                       ++disownedcnt;
+       }
+
+       int weapon_cnt = WEP_COUNT - disownedcnt;
+
+       if(weapon_cnt <= 0)
+               return pos;
+
+       int rows;
+       if(autocvar_scoreboard_accuracy_doublerows && weapon_cnt >= floor(WEP_COUNT * 0.5))
                rows = 2;
        else
                rows = 1;
+       int columnns = ceil(weapon_cnt / rows);
+
        float height = 40;
        float fontsize = height * 1/3;
        float weapon_height = height * 2/3;
-       float weapon_width = sbwidth / weapon_cnt;
-       float g_instagib = 0;
+       float weapon_width = sbwidth / columnns / rows;
 
        drawstring(pos, sprintf(_("Accuracy stats (average %d%%)"), average_accuracy), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
        pos.y += 1.25 * hud_fontsize.y + autocvar_scoreboard_border_thickness;
        vector tmp = '0 0 0';
-       tmp_x = sbwidth;
-       tmp_y = height * rows;
+       tmp.x = sbwidth;
+       tmp.y = height * rows;
 
        if (teamplay)
                drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
@@ -1015,7 +1024,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
        drawborderlines(autocvar_scoreboard_border_thickness, pos, tmp, '0 0 0', scoreboard_alpha_bg * 0.75, DRAWFLAG_NORMAL);
 
        // column highlighting
-       for(i = 0; i < weapon_cnt/rows; ++i)
+       for(i = 0; i < columnns; ++i)
        {
                if(!(i % 2))
                        drawfill(pos + '1 0 0' * weapon_width * rows * i, '0 1 0' * height * rows + '1 0 0' * weapon_width * rows, '0 0 0', scoreboard_alpha_bg * 0.2, DRAWFLAG_NORMAL);
@@ -1028,29 +1037,29 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
        }
 
        average_accuracy = 0;
-       float weapons_with_stats;
-       weapons_with_stats = 0;
+       int weapons_with_stats = 0;
        if(rows == 2)
                pos.x += weapon_width / 2;
 
-       if(switchweapon == WEP_VAPORIZER)
-               g_instagib = 1; // TODO: real detection for instagib?
-
-       float weapon_stats;
        if(autocvar_scoreboard_accuracy_nocolors)
                rgb = '1 1 1';
        else
                Accuracy_LoadColors();
 
-       for(i = WEP_FIRST; i <= WEP_LAST; ++i)
+       float oldposx = pos.x;
+       vector tmpos = pos;
+
+       int column;
+       for(i = WEP_FIRST, column = 0; i <= WEP_LAST; ++i)
        {
                self = get_weaponinfo(i);
                if (!self.weapon)
                        continue;
-               if ((i == WEP_VORTEX && g_instagib) || i == WEP_PORTO || (i == WEP_VAPORIZER && !g_instagib) || i == WEP_TUBA) // skip port-o-launch, vortex || vaporizer and tuba
-                       continue;
                weapon_stats = weapon_accuracy[i-WEP_FIRST];
 
+               if(weapon_stats < 0 && !(weapons_stat & WepSet_FromWeapon(i) || weapons_inmap & WepSet_FromWeapon(i)))
+                       continue;
+
                float weapon_alpha;
                if(weapon_stats >= 0)
                        weapon_alpha = scoreboard_alpha_fg;
@@ -1058,7 +1067,7 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
                        weapon_alpha = 0.2 * scoreboard_alpha_fg;
 
                // weapon icon
-               drawpic_aspect_skin(pos, self.model2, '1 0 0' * weapon_width + '0 1 0' * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
+               drawpic_aspect_skin(tmpos, self.model2, '1 0 0' * weapon_width + '0 1 0' * weapon_height, '1 1 1', weapon_alpha, DRAWFLAG_NORMAL);
                // the accuracy
                if(weapon_stats >= 0) {
                        weapons_with_stats += 1;
@@ -1073,24 +1082,24 @@ vector HUD_DrawScoreboardAccuracyStats(vector pos, vector rgb, vector bg_size)
                        if(!autocvar_scoreboard_accuracy_nocolors)
                                rgb = Accuracy_GetColor(weapon_stats);
 
-                       drawstring(pos + '1 0 0' * padding + '0 1 0' * weapon_height, s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
+                       drawstring(tmpos + '1 0 0' * padding + '0 1 0' * weapon_height, s, '1 1 0' * fontsize, rgb, scoreboard_alpha_fg, DRAWFLAG_NORMAL);
                }
+               tmpos.x += weapon_width * rows;
                pos.x += weapon_width * rows;
-               if(rows == 2 && i == 6) {
-                       pos.x -= sbwidth;
+               if(rows == 2 && column == columnns - 1) {
+                       tmpos.x = oldposx;
+                       tmpos.y += height;
                        pos.y += height;
                }
+               ++column;
        }
 
        if(weapons_with_stats)
                average_accuracy = floor((average_accuracy * 100 / weapons_with_stats) + 0.5);
 
-       if(rows == 2)
-               pos.x -= weapon_width / 2;
-       pos.x -= sbwidth;
        pos.y += height;
-
-       pos.y +=  1.25 * hud_fontsize.y;
+       pos.y += 1.25 * hud_fontsize.y;
+       pos.x = initial_posx;
        return pos;
 }
 
@@ -1098,9 +1107,9 @@ vector HUD_DrawKeyValue(vector pos, string key, string value) {
        float px = pos.x;
        pos.x += hud_fontsize.x * 0.25;
        drawstring(pos, key, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       pos_x = xmax - stringwidth(value, false, hud_fontsize) - hud_fontsize.x * 0.25;
+       pos.x = xmax - stringwidth(value, false, hud_fontsize) - hud_fontsize.x * 0.25;
        drawstring(pos, value, hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
-       pos_x = px;
+       pos.x = px;
        pos.y+= hud_fontsize.y;
 
        return pos;
@@ -1136,8 +1145,8 @@ vector HUD_DrawMapStats(vector pos, vector rgb, vector bg_size) {
 
        // draw table
        vector tmp = '0 0 0';
-       tmp_x = sbwidth;
-       tmp_y = hud_fontsize.y * rows;
+       tmp.x = sbwidth;
+       tmp.y = hud_fontsize.y * rows;
 
        if (teamplay)
                drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
@@ -1179,16 +1188,16 @@ vector HUD_DrawScoreboardRankings(vector pos, entity pl,  vector rgb, vector bg_
        float is_spec;
        is_spec = (GetPlayerColor(pl.sv_entnum) == NUM_SPECTATOR);
        vector hl_rgb;
-       hl_rgb_x = autocvar_scoreboard_color_bg_r + 0.5;
-       hl_rgb_y = autocvar_scoreboard_color_bg_g + 0.5;
-       hl_rgb_z = autocvar_scoreboard_color_bg_b + 0.5;
+       hl_rgb.x = autocvar_scoreboard_color_bg_r + 0.5;
+       hl_rgb.y = autocvar_scoreboard_color_bg_g + 0.5;
+       hl_rgb.z = autocvar_scoreboard_color_bg_b + 0.5;
 
        pos.y += hud_fontsize.y;
        drawstring(pos, _("Rankings"), hud_fontsize, '1 1 1', scoreboard_alpha_fg, DRAWFLAG_NORMAL);
        pos.y += hud_fontsize.y + autocvar_scoreboard_border_thickness;
        vector tmp = '0 0 0';
-       tmp_x = sbwidth;
-       tmp_y = 1.25 * hud_fontsize.y * RANKINGS_RECEIVED_CNT;
+       tmp.x = sbwidth;
+       tmp.y = 1.25 * hud_fontsize.y * RANKINGS_RECEIVED_CNT;
 
        if (teamplay)
                drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb * autocvar_scoreboard_color_bg_team, scoreboard_alpha_bg, DRAWFLAG_NORMAL);
@@ -1272,9 +1281,9 @@ void HUD_DrawScoreboard()
        sbwidth = xmax - xmin;
 
        // Initializes position
-       pos_x = xmin;
-       pos_y = ymin;
-       pos_z = 0;
+       pos.x = xmin;
+       pos.y = ymin;
+       pos.z = 0;
 
        // Heading
        vector sb_heading_fontsize;
@@ -1311,15 +1320,15 @@ void HUD_DrawScoreboard()
 
                        pos = HUD_Scoreboard_MakeTable(pos, tm, rgb, bg_size);
                }
-               rgb_x = autocvar_scoreboard_color_bg_r;
-               rgb_y = autocvar_scoreboard_color_bg_g;
-               rgb_z = autocvar_scoreboard_color_bg_b;
+               rgb.x = autocvar_scoreboard_color_bg_r;
+               rgb.y = autocvar_scoreboard_color_bg_g;
+               rgb.z = autocvar_scoreboard_color_bg_b;
        }
        else
        {
-               rgb_x = autocvar_scoreboard_color_bg_r;
-               rgb_y = autocvar_scoreboard_color_bg_g;
-               rgb_z = autocvar_scoreboard_color_bg_b;
+               rgb.x = autocvar_scoreboard_color_bg_r;
+               rgb.y = autocvar_scoreboard_color_bg_g;
+               rgb.z = autocvar_scoreboard_color_bg_b;
 
                for(tm = teams.sort_next; tm; tm = tm.sort_next)
                {
@@ -1359,9 +1368,9 @@ void HUD_DrawScoreboard()
        specs = 0;
        tmp = pos;
        vector item_size;
-       item_size_x = sbwidth;
-       item_size_y = hud_fontsize.y * 1.25;
-       item_size_z = 0;
+       item_size.x = sbwidth;
+       item_size.y = hud_fontsize.y * 1.25;
+       item_size.z = 0;
        for(pl = players.sort_next; pl; pl = pl.sort_next)
        {
                if(pl.team != NUM_SPECTATOR)