diff --git a/src/sgame/sg_main.cpp b/src/sgame/sg_main.cpp index e4a0b7d91d8..d8eb9411958 100644 --- a/src/sgame/sg_main.cpp +++ b/src/sgame/sg_main.cpp @@ -1421,6 +1421,7 @@ void CalculateRanks() char P[ MAX_CLIENTS + 1 ] = "", B[ MAX_CLIENTS + 1 ] = ""; level.numConnectedClients = 0; + level.numConnectedPlayers = 0; level.numPlayingClients = 0; level.numPlayingPlayers = 0; level.numPlayingBots = 0; @@ -1469,6 +1470,7 @@ void CalculateRanks() else { level.team[ team ].numPlayers++; + level.numConnectedPlayers++; } if ( level.clients[ clientNum ].pers.connected != CON_CONNECTED ) diff --git a/src/sgame/sg_maprotation.cpp b/src/sgame/sg_maprotation.cpp index 9de5e68d787..aa55ccb6192 100644 --- a/src/sgame/sg_maprotation.cpp +++ b/src/sgame/sg_maprotation.cpp @@ -1199,15 +1199,7 @@ static bool G_EvaluateMapCondition( mrCondition_t **condition ) break; case CV_NUMPLAYERS: - { - int numPlayers = 0; - for ( int team = TEAM_NONE; team < NUM_TEAMS; team++ ) - { - numPlayers += level.team[ team ].numPlayers; - } - - result = G_EvaluateIntegerCondition(localCondition, numPlayers); - } + result = G_EvaluateIntegerCondition(localCondition, level.numConnectedPlayers); break; case CV_NUMCLIENTS: diff --git a/src/sgame/sg_struct.h b/src/sgame/sg_struct.h index 63f28a04ce3..5df93140353 100644 --- a/src/sgame/sg_struct.h +++ b/src/sgame/sg_struct.h @@ -624,6 +624,7 @@ struct level_locals_s bool restarted; // waiting for a map_restart to fire int numConnectedClients; // connected + int numConnectedPlayers; // connected players (not bot) in a team or spec mode int numAliveClients; // on a team and alive int numPlayingClients; // on a team int numPlayingPlayers; // on a team and not a bot