diff options
author | Tim Angus <tim@ngus.net> | 2007-03-24 13:06:14 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2007-03-24 13:06:14 +0000 |
commit | b746d797266c9fd4d4cb92845d98e611bb501605 (patch) | |
tree | ad658cadceb03b4bf50ab1cdbae7d0492d343555 | |
parent | bec564b10d65313f4030766e6b275d1198e22585 (diff) |
* Minor efficiency/readability improvement to g_chatTeamPrefix code
-rw-r--r-- | src/game/g_cmds.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index a139a9a8..cc8e0a5e 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -809,32 +809,34 @@ static void G_SayTo( gentity_t *ent, gentity_t *other, int mode, int color, cons 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 ]; + int j; + gentity_t *other; + int color; + const char *prefix; + char name[ 64 ]; // don't let text be too long for malicious reasons - char text[ MAX_SAY_TEXT ]; - char location[ 64 ]; + 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] "); + prefix = "[S] "; break; case PTE_ALIENS: - Com_sprintf( prefix, sizeof( prefix ), "[A] "); + prefix = "[A] "; break; case PTE_HUMANS: - Com_sprintf( prefix, sizeof( prefix ), "[H] "); + prefix = "[H] "; } + } else - prefix[ 0 ] = '\0'; + prefix = ""; switch( mode ) { |