From 1509862b0941d153c444bda64128118dfde867ba Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 4 Jan 2005 07:20:13 +0000 Subject: [PATCH] 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 --- engine/client/cl_parse.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index fb7c97177..9bbcfd82f 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -3358,11 +3358,28 @@ int getplayerchatcolour(char *msg) id = getplayerid(msg); if (id == -1) //not a user/server return 1; + + //primary override. msg = Info_ValueForKey(cl.players[id].userinfo, "tc"); - if (!*msg) - return cl.players[id].userid; - c = atoi(msg); - return c; + if (*msg) + { + c = atoi(msg); + 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);