]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Rename Team_*ControlPoints functions to Team_*OwnedItems so they can be used without...
authorterencehill <piuntn@gmail.com>
Fri, 31 Dec 2021 14:59:58 +0000 (15:59 +0100)
committerterencehill <piuntn@gmail.com>
Fri, 31 Dec 2021 14:59:58 +0000 (15:59 +0100)
qcsrc/common/gamemodes/gamemode/domination/sv_domination.qc
qcsrc/common/gamemodes/gamemode/onslaught/sv_onslaught.qc
qcsrc/server/teamplay.qc
qcsrc/server/teamplay.qh

index ac8e48856ec58c3524994e430e09e6955e56effb..80bbf6532a436011640e16ce6546f30172f8f090 100644 (file)
@@ -311,7 +311,7 @@ void Domination_count_controlpoints()
        total_control_points = 0;
        for (int i = 1; i <= NUM_TEAMS; ++i)
        {
-               Team_SetNumberOfControlPoints(Team_GetTeamFromIndex(i), 0);
+               Team_SetNumberOfOwnedItems(Team_GetTeamFromIndex(i), 0);
        }
        IL_EACH(g_dompoints, true,
        {
@@ -321,9 +321,9 @@ void Domination_count_controlpoints()
                        continue;
                }
                entity team_ = Entity_GetTeam(it.goalentity);
-               int num_control_points = Team_GetNumberOfControlPoints(team_);
+               int num_control_points = Team_GetNumberOfOwnedItems(team_);
                ++num_control_points;
-               Team_SetNumberOfControlPoints(team_, num_control_points);
+               Team_SetNumberOfOwnedItems(team_, num_control_points);
        });
 }
 
@@ -340,7 +340,7 @@ bool Domination_CheckWinner()
        }
 
        Domination_count_controlpoints();
-       int winner_team = Team_GetWinnerTeam_WIthControlPoints(total_control_points);
+       int winner_team = Team_GetWinnerTeam_WIthOwnedItems(total_control_points);
        if (winner_team == -1)
                return 0;
 
index 58fc8a3662888e664b22dd63591654bd73bb352a..c071be0e0e63108817b641c71402885dd2d92b67 100644 (file)
@@ -1126,7 +1126,7 @@ void Onslaught_count_generators()
        total_generators = 0;
        for (int i = 1; i <= NUM_TEAMS; ++i)
        {
-               Team_SetNumberOfControlPoints(Team_GetTeamFromIndex(i), 0);
+               Team_SetNumberOfOwnedItems(Team_GetTeamFromIndex(i), 0);
        }
        for(e = ons_worldgeneratorlist; e; e = e.ons_worldgeneratornext)
        {
@@ -1136,9 +1136,9 @@ void Onslaught_count_generators()
                        continue;
                }
                entity team_ = Entity_GetTeam(e);
-               int num_control_points = Team_GetNumberOfControlPoints(team_);
-               ++num_control_points;
-               Team_SetNumberOfControlPoints(team_, num_control_points);
+               int num_generators = Team_GetNumberOfOwnedItems(team_);
+               ++num_generators;
+               Team_SetNumberOfOwnedItems(team_, num_generators);
        }
 }
 
@@ -1188,7 +1188,7 @@ bool Onslaught_CheckWinner()
        else { wpforenemy_announced = false; ons_stalemate = false; }
 
        Onslaught_count_generators();
-       int winner_team = Team_GetWinnerTeam_WIthControlPoints(1); // actually generators
+       int winner_team = Team_GetWinnerTeam_WIthOwnedItems(1);
        if (!winner_team)
                return 0;
 
index b1edf75e40de5831c9dcb3fdeccba5079447bb71..7257156a9693b44b28b4b2ed7698d11702f507eb 100644 (file)
@@ -35,7 +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.
+.int m_num_owned_items; ///< Number of items owned by a team.
 
 string autocvar_g_forced_team_red;
 string autocvar_g_forced_team_blue;
@@ -120,12 +120,12 @@ int Team_GetNumberOfAliveTeams()
        return result;
 }
 
-int Team_GetWinnerTeam_WIthControlPoints(int min_control_points)
+int Team_GetWinnerTeam_WIthOwnedItems(int min_control_points)
 {
        int winner = 0;
        for (int i = 0; i < NUM_TEAMS; ++i)
        {
-               if (g_team_entities[i].m_num_control_points >= min_control_points)
+               if (g_team_entities[i].m_num_owned_items >= min_control_points)
                {
                        if (winner)
                                return 0;
@@ -135,22 +135,22 @@ int Team_GetWinnerTeam_WIthControlPoints(int min_control_points)
        return (winner ? winner : -1);
 }
 
-int Team_GetNumberOfControlPoints(entity team_ent)
+int Team_GetNumberOfOwnedItems(entity team_ent)
 {
-       return team_ent.m_num_control_points;
+       return team_ent.m_num_owned_items;
 }
 
-void Team_SetNumberOfControlPoints(entity team_ent, int number)
+void Team_SetNumberOfOwnedItems(entity team_ent, int number)
 {
-       team_ent.m_num_control_points = number;
+       team_ent.m_num_owned_items = number;
 }
 
-int Team_GetNumberOfTeamsWithControlPoints()
+int Team_GetNumberOfTeamsWithOwnedItems()
 {
        int result = 0;
        for (int i = 0; i < NUM_TEAMS; ++i)
        {
-               if (g_team_entities[i].m_num_control_points > 0)
+               if (g_team_entities[i].m_num_owned_items > 0)
                {
                        ++result;
                }
index c7b2ac8d09988c1d140979a17bdae24d60c38d99..a94b247a8a64150d78ba6c1ca52200ff16b70350 100644 (file)
@@ -60,23 +60,23 @@ int Team_GetWinnerAliveTeam();
 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);
+/// \param[in] min_owned_items Minimum number of items the winner team must have.
+/// \return Winner team or 0 if 2 or more teams own items or -1 if no team own any items.
+int Team_GetWinnerTeam_WIthOwnedItems(int min_owned_items);
 
-/// \brief Returns the number of control points owned by a team.
+/// \brief Returns the number of items owned by a team.
 /// \param[in] team_ent Team entity.
-/// \return Number of control points owned by a team.
-int Team_GetNumberOfControlPoints(entity team_ent);
+/// \return Number of items owned by a team.
+int Team_GetNumberOfOwnedItems(entity team_ent);
 
-/// \brief Sets the number of control points owned by a team.
+/// \brief Sets the number of items owned by a team.
 /// \param[in,out] team_ent Team entity.
-/// \param[in] number Number of control points to set.
-void Team_SetNumberOfControlPoints(entity team_ent, int number);
+/// \param[in] number Number of items to set.
+void Team_SetNumberOfOwnedItems(entity team_ent, int number);
 
-/// \brief Returns the number of teams that own control points.
-/// \return Number of teams that own control points.
-int Team_GetNumberOfTeamsWithControlPoints();
+/// \brief Returns the number of teams that own items.
+/// \return Number of teams that own items.
+int Team_GetNumberOfTeamsWithOwnedItems();
 
 // ======================= Entity specific API ================================