From 45dac4d0e9707260179206bb26fd7d6615d1254c Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 4 Sep 2021 15:10:48 +0200 Subject: [PATCH] Fix typo in a variable name --- qcsrc/client/hud/panel/scoreboard.qc | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/qcsrc/client/hud/panel/scoreboard.qc b/qcsrc/client/hud/panel/scoreboard.qc index c0e0f04ae..b3d24e59d 100644 --- a/qcsrc/client/hud/panel/scoreboard.qc +++ b/qcsrc/client/hud/panel/scoreboard.qc @@ -1241,7 +1241,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) int rows = 1; if (autocvar_hud_panel_scoreboard_accuracy_doublerows && weapon_cnt >= floor((REGISTRY_COUNT(Weapons) - nHidden - 1) * 0.5)) rows = 2; - int columnns = ceil(weapon_cnt / rows); + int columns = ceil(weapon_cnt / rows); float aspect = max(0.001, autocvar_hud_panel_weapons_aspect); float weapon_height = hud_fontsize.y * 2.3 / aspect; @@ -1274,7 +1274,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) pos = panel_pos; vector tmp = panel_size; - float weapon_width = tmp.x / columnns / rows; + float weapon_width = tmp.x / columns / rows; if (sbt_bg_alpha) drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, sbt_bg_alpha * scoreboard_acc_fade_alpha, DRAWFLAG_NORMAL); @@ -1282,7 +1282,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) if(sbt_highlight) { // column highlighting - for (int i = 0; i < columnns; ++i) + for (int i = 0; i < columns; ++i) if ((i % 2) == 0) drawfill(pos + eX * weapon_width * rows * i, vec2(weapon_width * rows, height * rows), '0 0 0', sbt_highlight_alpha * scoreboard_acc_fade_alpha, DRAWFLAG_NORMAL); @@ -1327,11 +1327,8 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) weapons_with_stats += 1; average_accuracy += weapon_stats; // store sum of all accuracies in average_accuracy - string s; - s = sprintf("%d%%", weapon_stats * 100); - - float padding; - padding = (weapon_width - stringwidth(s, false, hud_fontsize)) / 2; // center the accuracy value + string s = sprintf("%d%%", weapon_stats * 100); + float padding = (weapon_width - stringwidth(s, false, hud_fontsize)) / 2; if(!autocvar_hud_panel_scoreboard_accuracy_nocolors) rgb = Accuracy_GetColor(weapon_stats); @@ -1340,7 +1337,7 @@ vector Scoreboard_AccuracyStats_Draw(vector pos, vector rgb, vector bg_size) } tmpos.x += weapon_width * rows; pos.x += weapon_width * rows; - if (rows == 2 && column == columnns - 1) { + if (rows == 2 && column == columns - 1) { tmpos.x = oldposx; tmpos.y += height; pos.y += height; @@ -1402,7 +1399,7 @@ vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size) if (n <= 0) return pos; int rows = (autocvar_hud_panel_scoreboard_itemstats_doublerows && n >= floor(REGISTRY_COUNT(Items) / 2)) ? 2 : 1; - int columnns = max(6, ceil(n / rows)); + int columns = max(6, ceil(n / rows)); float item_height = hud_fontsize.y * 2.3; float height = item_height + hud_fontsize.y; @@ -1434,7 +1431,7 @@ vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size) pos = panel_pos; vector tmp = panel_size; - float item_width = tmp.x / columnns / rows; + float item_width = tmp.x / columns / rows; if (sbt_bg_alpha) drawpic_tiled(pos, "gfx/scoreboard/scoreboard_bg", bg_size, tmp, rgb, sbt_bg_alpha * scoreboard_itemstats_fade_alpha, DRAWFLAG_NORMAL); @@ -1442,7 +1439,7 @@ vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size) if(sbt_highlight) { // column highlighting - for (int i = 0; i < columnns; ++i) + for (int i = 0; i < columns; ++i) if ((i % 2) == 0) drawfill(pos + eX * item_width * rows * i, vec2(item_width * rows, height * rows), '0 0 0', sbt_highlight_alpha * scoreboard_itemstats_fade_alpha, DRAWFLAG_NORMAL); @@ -1468,7 +1465,7 @@ vector Scoreboard_ItemStats_Draw(vector pos, vector rgb, vector bg_size) drawstring(tmpos + vec2(padding, item_height), s, hud_fontsize, '1 1 1', panel_fg_alpha * scoreboard_itemstats_fade_alpha, DRAWFLAG_NORMAL); tmpos.x += item_width * rows; pos.x += item_width * rows; - if (rows == 2 && column == columnns - 1) { + if (rows == 2 && column == columns - 1) { tmpos.x = oldposx; tmpos.y += height; pos.y += height; -- 2.39.2