]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/teamplay.qh
Simplify and share some duplicated code
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / teamplay.qh
index 5cce9758dfb63dc44e0c798033ffa5aaf51ad965..c7b2ac8d09988c1d140979a17bdae24d60c38d99 100644 (file)
@@ -12,6 +12,8 @@ string autocvar_g_forced_team_otherwise;
 
 bool lockteams;
 
+.int team_forced; // can be a team number to force a team, or 0 for default action, or -1 for forced spectator
+
 // ========================== Global teams API ================================
 
 void Team_InitTeams();
@@ -49,10 +51,19 @@ int Team_GetNumberOfAlivePlayers(entity team_ent);
 /// \param[in] number Number of players to set.
 void Team_SetNumberOfAlivePlayers(entity team_ent, int number);
 
+/// \brief Returns the winner team.
+/// \return Winner team or 0 if 2 or more teams have alive players or -1 if no team has any alive players.
+int Team_GetWinnerAliveTeam();
+
 /// \brief Returns the number of alive teams.
 /// \return Number of alive teams.
 int Team_GetNumberOfAliveTeams();
 
+/// \brief Returns the winner team.
+/// \param[in] min_control_points Minimum number of control points the winner team must have.
+/// \return Winner team or 0 if 2 or more teams have control points or -1 if no team has any control points.
+int Team_GetWinnerTeam_WIthControlPoints(int min_control_points);
+
 /// \brief Returns the number of control points owned by a team.
 /// \param[in] team_ent Team entity.
 /// \return Number of control points owned by a team.