ULONG CALLVOTE_CountNumEligibleVoters( void ) { ULONG ulIdx; ULONG ulIdx2; ULONG ulNumVoters; ulNumVoters = 0; for ( ulIdx = 0; ulIdx < MAXPLAYERS; ulIdx++ ) { // A voter is anyone in the game who isn't a bot. if (( playeringame[ulIdx]) && ( players[ulIdx].bIsBot == false )) { // Ch0wW: Don't accept spectators to be counted as valid voters. -- [Don't forget to thank me!] if (players[ulIdx].bSpectating && sv_nocallvote == 2) continue; // Go through and see if anyone has an IP that matches this person's. if ( NETWORK_GetState( ) == NETSTATE_SERVER ) { for ( ulIdx2 = ulIdx; ulIdx2 < MAXPLAYERS; ulIdx2++ ) { if (( playeringame[ulIdx2] == false) || ( ulIdx == ulIdx2 ) || ( SERVER_IsValidClient( ulIdx2 ) == false )) { continue; } // If the two IP addresses match, break out. // if ( NETWORK_CompareAddress( SERVER_GetClient( ulIdx )->Address, SERVER_GetClient( ulIdx2 )->Address, true )) // break; } if ( ulIdx2 == MAXPLAYERS ) ulNumVoters++; } else ulNumVoters++; } } return ( ulNumVoters ); }