]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/hud/panel/scoreboard.qc
Merge branch 'z411/speed_unit' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / hud / panel / scoreboard.qc
index 174426e910b7555069bc8654afb502b1c8cdc397..484968a9c39a20ebf3b380c1d90e98d6b87dbb29 100644 (file)
@@ -2458,7 +2458,8 @@ void Scoreboard_Draw()
 
        if(MUTATOR_CALLHOOK(ShowRankings)) {
                string ranktitle = M_ARGV(0, string);
-               string unit = GetSpeedUnit(autocvar_hud_panel_physics_speed_unit);
+               string unit = GetSpeedUnit(autocvar_hud_speed_unit);
+               float conversion_factor = GetSpeedUnitFactor(autocvar_hud_speed_unit);
                if(race_speedaward_alltimebest)
                {
                        string name;
@@ -2467,11 +2468,11 @@ void Scoreboard_Draw()
                        if(race_speedaward)
                        {
                                name = textShortenToWidth(ColorTranslateRGB(race_speedaward_holder), namesize, hud_fontsize, stringwidth_colors);
-                               str = sprintf(_("Speed award: %d%s ^7(%s^7)"), race_speedaward, unit, name);
+                               str = sprintf(_("Speed award: %d%s ^7(%s^7)"), race_speedaward * conversion_factor, unit, name);
                                str = strcat(str, " / ");
                        }
                        name = textShortenToWidth(ColorTranslateRGB(race_speedaward_alltimebest_holder), namesize, hud_fontsize, stringwidth_colors);
-                       str = strcat(str, sprintf(_("All-time fastest: %d%s ^7(%s^7)"), race_speedaward_alltimebest, unit, name));
+                       str = strcat(str, sprintf(_("All-time fastest: %d%s ^7(%s^7)"), race_speedaward_alltimebest * conversion_factor, unit, name));
                        drawcolorcodedstring(pos, str, hud_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
                        pos.y += 1.25 * hud_fontsize.y; // line height + line spacing
                }