summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
authorBen Millwood <thebenmachine@gmail.com>2009-10-03 12:10:48 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:15:44 +0000
commitb3691bd7f4c27e9ac216bb96d80a09a7cb7e2349 (patch)
treecba50449a677a0612732fde38141a4e255cec85a /src/game/g_main.c
parentb8696658e67bf459c1e2538e8f1b6a6297143adc (diff)
* Use chat rather than print for adminchat server commands
* Fixes to ready code: supports MAX_CLIENTS slots without relying on its value * Removing references to an apparently useless escape character in chat
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c19
1 files changed, 9 insertions, 10 deletions
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;