diff options
Diffstat (limited to 'src/game/g_cmds.c')
-rw-r--r-- | src/game/g_cmds.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 1816b8f5..d2bf150e 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -3151,10 +3151,18 @@ void G_ListCommands( gentity_t *ent ) void G_DecolorString( char *in, char *out, int len ) { + qboolean decolor = qtrue; + len--; while( *in && len > 0 ) { - if( Q_IsColorString( in ) ) { + if( *in == DECOLOR_OFF || *in == DECOLOR_ON ) + { + decolor = ( *in == DECOLOR_ON ); + in++; + continue; + } + if( Q_IsColorString( in ) && decolor ) { in += 2; continue; } @@ -3164,6 +3172,22 @@ void G_DecolorString( char *in, char *out, int len ) *out = '\0'; } +void G_UnEscapeString( char *in, char *out, int len ) +{ + len--; + + while( *in && len > 0 ) + { + if( *in >= ' ' || *in == '\n' ) + { + *out++ = *in; + len--; + } + in++; + } + *out = '\0'; +} + void Cmd_PrivateMessage_f( gentity_t *ent ) { int pids[ MAX_CLIENTS ]; |