From: z411 Date: Fri, 28 Aug 2020 17:15:23 +0000 (-0400) Subject: Chat tags fixed X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=dea0423766f48451e1947068e8b5fcc951ec3fcc;p=xonotic%2Fxonotic-data.pk3dir.git Chat tags fixed --- diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index f1e3f0040..1b151d244 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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"; diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 189684cb6..44268dd48 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -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); }