]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rank handle empty string
authorz411 <z411@omaera.org>
Tue, 25 Jan 2022 18:53:11 +0000 (15:53 -0300)
committerz411 <z411@omaera.org>
Tue, 25 Jan 2022 18:53:11 +0000 (15:53 -0300)
qcsrc/client/hud/panel/scoreboard.qc
qcsrc/client/hud/panel/spect.qc
qcsrc/common/ent_cs.qh

index fe096ecd1eafdf56bfeb7f8d865bfbb01e0cca50..a48219682c9de3fd7f4f765a731eb259b4b2c924 100644 (file)
@@ -1301,7 +1301,7 @@ void Scoreboard_Duel_DrawTable(vector pos, bool invert, entity pl, entity tm)
        
        // RJZ rank
        string rank_str = entcs_GetRank(pl.sv_entnum);
-       if(rank_str) {
+       if(rank_str != "") {
                if(invert)
                        tmp_in.x -= stringwidth_colors(rank_str, duel_name_fontsize) + duel_name_fontsize.x * 0.5;
                else
@@ -1317,7 +1317,7 @@ void Scoreboard_Duel_DrawTable(vector pos, bool invert, entity pl, entity tm)
        if(invert)
                tmp_in.x -= stringwidth_colors(tmp_str, duel_name_fontsize) + duel_name_fontsize.x * 0.5;
        else
-               tmp_in.x += (rank_str ? stringwidth_colors(rank_str, duel_name_fontsize) : duel_score_size.x) + duel_name_fontsize.x * 0.5;
+               tmp_in.x += (rank_str != "" ? stringwidth_colors(rank_str, duel_name_fontsize) : duel_score_size.x) + duel_name_fontsize.x * 0.5;
        drawcolorcodedstring(tmp_in, tmp_str, duel_name_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
        
        //LegendGuard adds a conditional sentence for country column 05-04-2021
index da20acf3377c194ef6b062c308356ac44bc4744b..818d4c927be7fb7961fcf442ccc0fba4226cf8c3 100644 (file)
@@ -258,7 +258,7 @@ void HUD_SpectHUD_drawDuelScore(vector pos, entity pl, bool invert)
        
        // RJZ rank
        string rank_str = entcs_GetRank(pl.sv_entnum);
-       if(rank_str) {
+       if(rank_str != "") {
                if(invert)
                        tmp.x -= stringwidth_colors(rank_str, teamname_fontsize) + teamname_fontsize.x * 0.5;
                else
@@ -275,7 +275,7 @@ void HUD_SpectHUD_drawDuelScore(vector pos, entity pl, bool invert)
        if(invert)
                tmp.x -= stringwidth_colors(tmp_str, teamname_fontsize) + teamname_fontsize.x * 0.5;
        else
-               tmp.x += (rank_str ? stringwidth_colors(rank_str, teamname_fontsize) : teamscore_size.x) + teamname_fontsize.x * 0.5;
+               tmp.x += (rank_str != "" ? stringwidth_colors(rank_str, teamname_fontsize) : teamscore_size.x) + teamname_fontsize.x * 0.5;
        
        drawcolorcodedstring(tmp, tmp_str, teamname_fontsize, panel_fg_alpha, DRAWFLAG_NORMAL);
 }
index 90a6550c543155790ee5e61961fa52946e1c8759..bd76c6b6b123f7d03044cb0c0898b0cab15f322c 100644 (file)
@@ -143,7 +143,7 @@ REGISTER_NET_TEMP(CLIENT_ENTCS)
        string entcs_GetRank(int i)
        {
                entity e = entcs_receiver(i);
-               return (e.rank != "" ? e.rank : string_null);
+               return e.rank;
        }
 
     /**