From 54f5e3660e26a65316b8a3c803f68c71d1513836 Mon Sep 17 00:00:00 2001 From: Lyberta Date: Sat, 14 Jul 2018 19:17:39 +0300 Subject: [PATCH] Teamplay: Made team balance entities destroy themselves on the next frame. --- qcsrc/server/teamplay.qc | 1 + qcsrc/server/teamplay.qh | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 5b9ab4db5..25acdd3e0 100644 --- a/qcsrc/server/teamplay.qc +++ b/qcsrc/server/teamplay.qc @@ -264,6 +264,7 @@ entity TeamBalance_CheckAllowedTeams(entity for_whom) team_ent.m_num_players = TEAM_NOT_ALLOWED; team_ent.m_num_bots = 0; } + setthink(balance, TeamBalance_Destroy); int teams_mask = 0; string teament_name = string_null; diff --git a/qcsrc/server/teamplay.qh b/qcsrc/server/teamplay.qh index 664a0eca4..f0ad95ce1 100644 --- a/qcsrc/server/teamplay.qh +++ b/qcsrc/server/teamplay.qh @@ -118,7 +118,8 @@ void LogTeamchange(float player_id, float team_number, int type); /// configuration and mutator settings. /// \param[in] for_whom Player to check for. Pass NULL for global rules. /// \return Team balance entity that holds information about teams. This entity -/// must be manually destroyed by calling TeamBalance_Destroy. +/// will be automatically destroyed on the next frame but you are encouraged to +/// manually destroy it by calling TeamBalance_Destroy for performance reasons. entity TeamBalance_CheckAllowedTeams(entity for_whom); /// \brief Destroy the team balance entity. -- 2.39.2