Skip to content
Permalink
Browse files

MapRotation : add 'numConnectedPlayers' to level_locals_s

  • Loading branch information
Dimitriio authored and illwieckz committed Jan 1, 2020
1 parent 2adfc0d commit c2763a4fd9d7952c033634e4f362006c741fd3fb
Showing with 4 additions and 9 deletions.
  1. +2 −0 src/sgame/sg_main.cpp
  2. +1 −9 src/sgame/sg_maprotation.cpp
  3. +1 −0 src/sgame/sg_struct.h
@@ -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 )
@@ -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:
@@ -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

0 comments on commit c2763a4

Please sign in to comment.
You can’t perform that action at this time.