diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cgame/cg_main.c | 19 | ||||
-rw-r--r-- | src/game/g_main.c | 2 |
2 files changed, 16 insertions, 5 deletions
diff --git a/src/cgame/cg_main.c b/src/cgame/cg_main.c index d8683d9e..55396704 100644 --- a/src/cgame/cg_main.c +++ b/src/cgame/cg_main.c @@ -1428,14 +1428,25 @@ static qboolean CG_ClientIsReady( int clientNum ) // each character of the hex string corresponds to 4 bits, which correspond // to readiness for client (0, 1, 2, 3...) i.e. the highest order bit // corresponds to the lowest clientnum - // because of this 1:4 ratio we only need one character for a given client + // so we only need one character for a given client int val = clientNum / 4; const char *s = CG_ConfigString( CS_CLIENTS_READY ); - while( *s && val-- > 0 ) - s++; + + while( *s && val > 0 ) + s++, val--; + if( !*s ) return qfalse; - sscanf( s, "%1x", &val ); + + if( isdigit( *s ) ) + val = *s - '0'; + else if( isxlower( *s ) ) + val = 10 + *s - 'a'; + else if( isxupper( *s ) ) + val = 10 + *s - 'A'; + else + return qfalse; + return ( ( val & 1 << ( 3 - clientNum % 4 ) ) != 0 ); } diff --git a/src/game/g_main.c b/src/game/g_main.c index b4d3974e..5fbdd4c5 100644 --- a/src/game/g_main.c +++ b/src/game/g_main.c @@ -1862,7 +1862,7 @@ void CheckIntermissionExit( void ) int i; gclient_t *cl; byte readyMasks[ ( MAX_CLIENTS + 7 ) / 8 ]; - char readyString[ 2 * sizeof( readyMasks ) + 1 ]; + char readyString[ 2 * sizeof( readyMasks ) + 1 ]; // a byte is 00 - ff //if no clients are connected, just exit if( !level.numConnectedClients ) |