Teamplay: Made team balance entities destroy themselves on the next frame.
authorLyberta <lyberta@lyberta.net>
Sat, 14 Jul 2018 16:17:39 +0000 (19:17 +0300)
committerLyberta <lyberta@lyberta.net>
Sat, 14 Jul 2018 16:17:39 +0000 (19:17 +0300)
qcsrc/server/teamplay.qc
qcsrc/server/teamplay.qh

index 5b9ab4db5faf240bcc887d156f083359521a19c1..25acdd3e01595b82a8f584c44bb8f8a72bf1e2d0 100644 (file)
@@ -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;
index 664a0eca404a8287629ff006b9f29ca84f6129e6..f0ad95ce18b7e421a51b40dbacb8e9026d987d50 100644 (file)
@@ -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.