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://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=54f5e3660e26a65316b8a3c803f68c71d1513836;hp=a5a4e26e6333d0b2fc4c9394141cd880c905a150 Teamplay: Made team balance entities destroy themselves on the next frame. --- diff --git a/qcsrc/server/teamplay.qc b/qcsrc/server/teamplay.qc index 5b9ab4db5f..25acdd3e01 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 664a0eca40..f0ad95ce18 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.