]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qc
Removed 'owned' global variables.
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qc
index 325252bcdb161f6ce936cf4ec9d8e19d99675a8b..d3fba6107b7397beef757b00179bdc84e8034aaa 100644 (file)
@@ -35,6 +35,7 @@ const int TEAM_NOT_ALLOWED = -1;
 .int m_num_players; ///< Number of players (both humans and bots) in a team.
 .int m_num_bots; ///< Number of bots in a team.
 .int m_num_players_alive; ///< Number of alive players in a team.
+.int m_num_control_points; ///< Number of control points owned by a team.
 .entity m_lowest_human; ///< Human with the lowest score in a team.
 .entity m_lowest_bot; ///< Bot with the lowest score in a team.
 
@@ -99,6 +100,29 @@ int Team_GetNumberOfAliveTeams()
        return result;
 }
 
+int Team_GetNumberOfControlPoints(entity team_)
+{
+       return team_.m_num_control_points;
+}
+
+void Team_SetNumberOfControlPoints(entity team_, int number)
+{
+       team_.m_num_control_points = number;
+}
+
+int Team_GetNumberOfTeamsWithControlPoints()
+{
+       int result = 0;
+       for (int i = 0; i < NUM_TEAMS; ++i)
+       {
+               if (g_team_entities[i].m_num_control_points > 0)
+               {
+                       ++result;
+               }
+       }
+       return result;
+}
+
 void TeamchangeFrags(entity e)
 {
        PlayerScore_Clear(e);