]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Chat tags fixed
authorz411 <z411@omaera.org>
Fri, 28 Aug 2020 17:15:23 +0000 (13:15 -0400)
committerz411 <z411@omaera.org>
Fri, 28 Aug 2020 17:15:23 +0000 (13:15 -0400)
qcsrc/server/client.qc
qcsrc/server/miscfunctions.qc

index f1e3f0040cce446d412dc2fdae382ada9c70425f..1b151d2449da2562004150d7e0c92931248cb1ad 100644 (file)
@@ -2893,8 +2893,14 @@ int Say(entity source, int teamsay, entity privatesay, string msgin, bool floodc
        */
 
        string namestr = "";
-       if (source)
+       if (source) {
                namestr = playername(source, autocvar_g_chat_teamcolors);
+               
+               if (IS_DEAD(p) || p.frags == FRAGS_PLAYER_OUT_OF_GAME)
+                       namestr = strcat("(DEAD) ", namestr);
+               else if (IS_OBSERVER(p) || IS_SPEC(p))
+                       namestr = strcat("(s) ", namestr);
+       }
 
        string colorprefix = (strdecolorize(namestr) == namestr) ? "^3" : "^7";
 
index 189684cb6e71441dba680202695f3691ae836e21..44268dd482c8297c6fcc88d45da1b94f59768b0d 100644 (file)
@@ -423,19 +423,10 @@ string playername(entity p, bool team_colorize)
     //else
     //    return p.netname;
        
-       string t;
-       
        if (team_colorize && teamplay && p.team != -1)
-               t = strcat(Team_ColorCode(p.team), strdecolorize(p.netname));
-       else
-               t = p.netname;
-       
-       if (IS_DEAD(p) || p.frags == FRAGS_PLAYER_OUT_OF_GAME)
-               return strcat("(DEAD) ", t);
-       else if (IS_OBSERVER(p) || IS_SPEC(p))
-               return strcat("(s) ", t);
+               return strcat(Team_ColorCode(p.team), strdecolorize(p.netname));
        else
-               return t;
+               return p.netname;
                
        //return sprintf("%s (%d) %s", p.classname, p.team, t);
 }