]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix rankings too
authorMario <mario@smbclan.net>
Sun, 12 Feb 2017 03:00:34 +0000 (13:00 +1000)
committerMario <mario@smbclan.net>
Sun, 12 Feb 2017 03:00:34 +0000 (13:00 +1000)
qcsrc/client/hud/panel/modicons.qc
qcsrc/client/main.qc

index a728f244786977115598f0c178af2fd617283313..b736dced60671a8025936d95b3c01dc844dabb6f 100644 (file)
@@ -494,7 +494,7 @@ int race_CheckName(string net_name)
 {
        int i;
        for (i=RANKINGS_CNT-1;i>=0;--i)
-               if(grecordholder[i] == net_name)
+               if(strdecolorize(grecordholder[i]) == strdecolorize(net_name))
                        return i+1;
        return 0;
 }
@@ -583,7 +583,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
        a = bound(0, race_status_time - time, 1);
 
        string s;
-       s = textShortenToWidth(race_status_name, squareSize, '1 1 0' * 0.1 * squareSize, stringwidth_colors);
+       s = textShortenToWidth(ColorTranslateRGB(race_status_name), squareSize, '1 1 0' * 0.1 * squareSize, stringwidth_colors);
 
        float rank;
        if(race_status > 0)
@@ -605,7 +605,7 @@ void HUD_Mod_Race(vector pos, vector mySize)
                drawcolorcodedstring_aspect(namepos, s, '1 0.2 0' * squareSize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
                drawstring_aspect(rankpos, rankname, '1 0.15 0' * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
        } else if(race_status == 2) {
-               if(race_status_name == entcs_GetName(player_localnum) || !race_myrank || race_myrank < rank)
+               if(strdecolorize(race_status_name) == strdecolorize(entcs_GetName(player_localnum)) || !race_myrank || race_myrank < rank)
                        drawpic_aspect_skin(medalPos + '0.1 0 0' * squareSize, "race_newrankgreen", '1 1 0' * 0.8 * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
                else
                        drawpic_aspect_skin(medalPos + '0.1 0 0' * squareSize, "race_newrankyellow", '1 1 0' * 0.8 * squareSize, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
index 4fbb2f282ad814e075e0283ca6be5aed918eec9c..a24d07d3ad08485dd0a1b878d0ea4f453e714c20 100644 (file)
@@ -1170,7 +1170,7 @@ NET_HANDLE(TE_CSQC_RACE, bool isNew)
                                strunzone(grecordholder[pos-1]);
                        grecordholder[pos-1] = strzone(ReadString());
                        grecordtime[pos-1] = ReadInt24_t();
-                       if(grecordholder[pos-1] == entcs_GetName(player_localnum))
+                       if(strdecolorize(grecordholder[pos-1]) == strdecolorize(entcs_GetName(player_localnum)))
                                race_myrank = pos;
                        break;
                case RACE_NET_SERVER_STATUS: