From: Lyberta Date: Sat, 14 Jul 2018 16:17:39 +0000 (+0300) Subject: Teamplay: Made team balance entities destroy themselves on the next frame. X-Git-Tag: xonotic-v0.8.5~1953^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=54f5e3660e26a65316b8a3c803f68c71d1513836;p=xonotic%2Fxonotic-data.pk3dir.git Teamplay: Made team balance entities destroy themselves on the next frame. --- 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.