Index: code/game/g_main.c =================================================================== --- code/game/g_main.c (revision 1788) +++ code/game/g_main.c (working copy) @@ -81,6 +81,7 @@ vmCvar_t pmove_msec; vmCvar_t g_rankings; vmCvar_t g_listEntity; +vmCvar_t g_humanplayers; #ifdef MISSIONPACK vmCvar_t g_obeliskHealth; vmCvar_t g_obeliskRegenPeriod; @@ -158,6 +159,8 @@ { &g_allowVote, "g_allowVote", "1", CVAR_ARCHIVE, 0, qfalse }, { &g_listEntity, "g_listEntity", "0", 0, 0, qfalse }, + { &g_humanplayers, "g_humanplayers", "0", CVAR_ROM | CVAR_NORESTART, 0, qfalse }, + #ifdef MISSIONPACK { &g_obeliskHealth, "g_obeliskHealth", "2500", 0, 0, qfalse }, { &g_obeliskRegenPeriod, "g_obeliskRegenPeriod", "1", 0, 0, qfalse }, @@ -757,6 +760,7 @@ int rank; int score; int newScore; + int humanplayers; gclient_t *cl; level.follow1 = -1; @@ -765,6 +769,7 @@ level.numNonSpectatorClients = 0; level.numPlayingClients = 0; level.numVotingClients = 0; // don't count bots + humanplayers = 0; // don't count bots for ( i = 0; i < TEAM_NUM_TEAMS; i++ ) { level.numteamVotingClients[i] = 0; } @@ -773,6 +778,11 @@ level.sortedClients[level.numConnectedClients] = i; level.numConnectedClients++; + // count connecting/connected humans + if ( !(g_entities[i].r.svFlags & SVF_BOT) ) { + humanplayers++; + } + if ( level.clients[i].sess.sessionTeam != TEAM_SPECTATOR ) { level.numNonSpectatorClients++; @@ -858,6 +868,10 @@ if ( level.intermissiontime ) { SendScoreboardMessageToAllClients(); } + + if (trap_Cvar_VariableIntegerValue( "g_humanplayers" ) != humanplayers) { + trap_Cvar_Set( "g_humanplayers", va("%i", humanplayers) ); + } }