diff options
Diffstat (limited to 'src/game')
-rw-r--r-- | src/game/g_cmds.c | 26 | ||||
-rw-r--r-- | src/game/g_main.c | 19 |
2 files changed, 21 insertions, 24 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 888e678e..1c47e77d 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -55,7 +55,7 @@ void G_SanitiseString( char *in, char *out, int len ) skip = qfalse; } - if( *in == 27 || Q_IsColorString( in ) ) + if( Q_IsColorString( in ) ) { in += 2; // skip color code continue; @@ -688,8 +688,6 @@ static void G_SayTo( gentity_t *ent, gentity_t *other, int mode, int color, cons name, Q_COLOR_ESCAPE, color, message, S_COLOR_WHITE ) ); } -#define EC "\x19" - void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText ) { int j; @@ -714,30 +712,30 @@ void G_Say( gentity_t *ent, gentity_t *target, int mode, const char *chatText ) default: case SAY_ALL: G_LogPrintf( "say: %s^7: %s\n", ent->client->pers.netname, chatText ); - Com_sprintf( name, sizeof( name ), "%s%s%c%c"EC": ", prefix, - ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE ); + Com_sprintf( name, sizeof( name ), "%s%s" S_COLOR_WHITE ": ", prefix, + ent->client->pers.netname ); color = COLOR_GREEN; break; case SAY_TEAM: G_LogPrintf( "sayteam: %s^7: %s\n", ent->client->pers.netname, chatText ); if( Team_GetLocationMsg( ent, location, sizeof( location ) ) ) - Com_sprintf( name, sizeof( name ), EC"(%s%c%c"EC") (%s)"EC": ", - ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE, location ); + Com_sprintf( name, sizeof( name ), "(%s" S_COLOR_WHITE ") (%s): ", + ent->client->pers.netname, location ); else - Com_sprintf( name, sizeof( name ), EC"(%s%c%c"EC")"EC": ", - ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE ); + Com_sprintf( name, sizeof( name ), "(%s" S_COLOR_WHITE "): ", + ent->client->pers.netname ); color = COLOR_CYAN; break; case SAY_TELL: if( target && OnSameTeam( target, ent ) && Team_GetLocationMsg( ent, location, sizeof( location ) ) ) - Com_sprintf( name, sizeof( name ), EC"[%s%c%c"EC"] (%s)"EC": ", - ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE, location ); + Com_sprintf( name, sizeof( name ), "[%s" S_COLOR_WHITE "] (%s): ", + ent->client->pers.netname, location ); else - Com_sprintf( name, sizeof( name ), EC"[%s%c%c"EC"]"EC": ", - ent->client->pers.netname, Q_COLOR_ESCAPE, COLOR_WHITE ); + Com_sprintf( name, sizeof( name ), "[%s" S_COLOR_WHITE "]: ", + ent->client->pers.netname ); color = COLOR_MAGENTA; break; } @@ -3156,7 +3154,7 @@ void G_DecolorString( char *in, char *out, int len ) len--; while( *in && len > 0 ) { - if( *in == 27 || Q_IsColorString( in ) ) { + if( Q_IsColorString( in ) ) { in++; if( *in ) in++; diff --git a/src/game/g_main.c b/src/game/g_main.c index 820108dc..b46c1b2e 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1654,9 +1654,9 @@ void QDECL G_AdminsPrintf( const char *prefix, const char *fmt, ... ) // Send to all appropriate clients for( i = 0; i < level.maxclients; i++ ) { - if( G_admin_permission( &g_entities[ i ], ADMF_ADMINCHAT) ) + if( G_admin_permission( &g_entities[ i ], ADMF_ADMINCHAT ) ) { - trap_SendServerCommand( i, va( "print \"%s\"", outstring ) ); + trap_SendServerCommand( i, va( "chat \"%s\"", outstring ) ); } } @@ -1858,14 +1858,15 @@ wait 10 seconds before going on. */ void CheckIntermissionExit( void ) { - int ready, notReady, numPlayers; + int ready, notReady; int i; gclient_t *cl; byte readyMasks[ ( MAX_CLIENTS + 7 ) / 8 ]; - char readyString[ 2 * sizeof( readyMasks ) + 1 ]; // a byte is 00 - ff + // each byte in readyMasks will become two characters 00 - ff in the string + char readyString[ 2 * sizeof( readyMasks ) + 1 ]; //if no clients are connected, just exit - if( !level.numConnectedClients ) + if( level.numConnectedClients == 0 ) { ExitLevel( ); return; @@ -1874,11 +1875,11 @@ void CheckIntermissionExit( void ) // see which players are ready ready = 0; notReady = 0; - numPlayers = 0; Com_Memset( readyMasks, 0, sizeof( readyMasks ) ); for( i = 0; i < g_maxclients.integer; i++ ) { cl = level.clients + i; + if( cl->pers.connected != CON_CONNECTED ) continue; @@ -1893,8 +1894,6 @@ void CheckIntermissionExit( void ) } else notReady++; - - numPlayers++; } // this is hex because we can convert bits to a hex string in pieces, @@ -1918,14 +1917,14 @@ void CheckIntermissionExit( void ) } // if nobody wants to go, clear timer - if( !ready && numPlayers ) + if( ready == 0 && notReady > 0 ) { level.readyToExit = qfalse; return; } // if everyone wants to go, go now - if( !notReady ) + if( notReady == 0 ) { ExitLevel( ); return; |