summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTim Angus <tim@ngus.net>2006-07-31 17:45:47 +0000
committerTim Angus <tim@ngus.net>2006-07-31 17:45:47 +0000
commitc999c50a24348489e5f705aa4b07bdcdf6b0658e (patch)
tree16ca91faeff53ef4047c39e4ac555e61401cf9c6 /src
parent061c247375c8aac977a3588a1dfb2382634da80e (diff)
* Phil Bordelon's g_chatTeamPrefix patch
Diffstat (limited to 'src')
-rw-r--r--src/game/g_cmds.c23
-rw-r--r--src/game/g_local.h1
-rw-r--r--src/game/g_main.c3
3 files changed, 25 insertions, 2 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 27329adb..7bef68c2 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -601,18 +601,37 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText )
int j;
gentity_t *other;
int color;
+ char prefix[ 5 ];
char name[ 64 ];
// don't let text be too long for malicious reasons
char text[ MAX_SAY_TEXT ];
char location[ 64 ];
+ if (g_chatTeamPrefix.integer)
+ switch( ent->client->pers.teamSelection)
+ {
+ default:
+ case PTE_NONE:
+ Com_sprintf( prefix, sizeof( prefix ), "[S] ");
+ break;
+
+ case PTE_ALIENS:
+ Com_sprintf( prefix, sizeof( prefix ), "[A] ");
+ break;
+
+ case PTE_HUMANS:
+ Com_sprintf( prefix, sizeof( prefix ), "[H] ");
+ }
+ else
+ Com_sprintf( prefix, sizeof( prefix ), "");
+
switch( mode )
{
default:
case SAY_ALL:
G_LogPrintf( "say: %s: %s\n", ent->client->pers.netname, chatText );
- Com_sprintf( name, sizeof( name ), "%s%c%c"EC": ", ent->client->pers.netname,
- Q_COLOR_ESCAPE, COLOR_WHITE );
+ Com_sprintf( name, sizeof( name ), "%s%s%c%c"EC": ", prefix,
+ ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE );
color = COLOR_GREEN;
break;
diff --git a/src/game/g_local.h b/src/game/g_local.h
index fa88d773..cbe9401d 100644
--- a/src/game/g_local.h
+++ b/src/game/g_local.h
@@ -1079,6 +1079,7 @@ extern vmCvar_t g_debugMapRotation;
extern vmCvar_t g_currentMapRotation;
extern vmCvar_t g_currentMap;
extern vmCvar_t g_initialMapRotation;
+extern vmCvar_t g_chatTeamPrefix;
extern vmCvar_t g_mapConfigs;
diff --git a/src/game/g_main.c b/src/game/g_main.c
index e6a64f9c..b0e1bdeb 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -112,6 +112,7 @@ vmCvar_t g_currentMap;
vmCvar_t g_initialMapRotation;
vmCvar_t g_mapConfigs;
+vmCvar_t g_chatTeamPrefix;
static cvarTable_t gameCvarTable[ ] =
{
@@ -202,6 +203,8 @@ static cvarTable_t gameCvarTable[ ] =
{ &g_disabledClasses, "g_disabledClasses", "", CVAR_ROM, 0, qfalse },
{ &g_disabledBuildables, "g_disabledBuildables", "", CVAR_ROM, 0, qfalse },
+ { &g_chatTeamPrefix, "g_chatTeamPrefix", "0", CVAR_ARCHIVE },
+
{ &g_debugMapRotation, "g_debugMapRotation", "0", 0, 0, qfalse },
{ &g_currentMapRotation, "g_currentMapRotation", "-1", 0, 0, qfalse }, // -1 = NOT_ROTATING
{ &g_currentMap, "g_currentMap", "0", 0, 0, qfalse },