Make chat colours come out the same as for TF teams. It's a bit friendlier this way.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@703 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2005-01-04 07:20:13 +00:00
parent a400572be9
commit 1509862b09
1 changed files with 21 additions and 4 deletions

View File

@ -3358,13 +3358,30 @@ int getplayerchatcolour(char *msg)
id = getplayerid(msg); id = getplayerid(msg);
if (id == -1) //not a user/server if (id == -1) //not a user/server
return 1; return 1;
//primary override.
msg = Info_ValueForKey(cl.players[id].userinfo, "tc"); msg = Info_ValueForKey(cl.players[id].userinfo, "tc");
if (!*msg) if (*msg)
return cl.players[id].userid; {
c = atoi(msg); c = atoi(msg);
return c; return c;
} }
//override based on team
if (cl.teamfortress)
{
switch (cl.players[id].bottomcolor)
{ //translate q1 skin colours to console colours
case 4: //red
return 1;
case 13: //blue
return 5;
//fixme: add the others
}
}
return cl.players[id].userid;
}
#define SHOWNET(x) if(cl_shownet.value==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x); #define SHOWNET(x) if(cl_shownet.value==2)Con_Printf ("%3i:%s\n", msg_readcount-1, x);
#define SHOWNET2(x, y) if(cl_shownet.value==2)Con_Printf ("%3i:%3i:%s\n", msg_readcount-1, y, x); #define SHOWNET2(x, y) if(cl_shownet.value==2)Con_Printf ("%3i:%3i:%s\n", msg_readcount-1, y, x);
/* /*