diff options
author | M. Kristall <mkpdev@gmail.com> | 2011-02-02 02:22:15 +0000 |
---|---|---|
committer | Tim Angus <tim@ngus.net> | 2013-01-03 00:17:57 +0000 |
commit | 2116ed4483f21171f49b6c8f64f2dd3c55fb6925 (patch) | |
tree | 6dc960ef65b0dba0e56ded1963c10b4f73e998bc | |
parent | fc7605bebedf293153a2d25c0d303e1c444165a6 (diff) |
* Prevent color from changing partway through the line in namelog output (DevHC)
-rw-r--r-- | src/game/g_admin.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 0e2e84e4..b503adea 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -2639,12 +2639,14 @@ static void namelog_out( void *namelog, char *str ) namelog_t *n = (namelog_t *)namelog; char *p = str; int l, l2 = MAX_STRING_CHARS, i; + const char *scolor; if( n->slot > -1 ) { l = Q_snprintf( p, l2, "^3%-2d", n->slot ); p += l; l2 -= l; + scolor = S_COLOR_YELLOW; } else { @@ -2652,6 +2654,7 @@ static void namelog_out( void *namelog, char *str ) *p++ = ' '; *p = '\0'; l2 -= 2; + scolor = S_COLOR_WHITE; } for( i = 0; i < MAX_NAMELOG_ADDRS && n->ip[ i ].str[ 0 ]; i++ ) @@ -2663,8 +2666,8 @@ static void namelog_out( void *namelog, char *str ) for( i = 0; i < MAX_NAMELOG_NAMES && n->name[ i ][ 0 ]; i++ ) { - l = Q_snprintf( p, l2, " '%s" S_COLOR_WHITE "'%s", n->name[ i ], - ( i == n->nameOffset ) ? "*" : "" ); + l = Q_snprintf( p, l2, " '%s%s'%s", n->name[ i ], scolor, + i == n->nameOffset ? "*" : "" ); p += l; l2 -= l; } |