mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Don't check sv_max_team_size
for teams in practice
This commit is contained in:
parent
003a58cdc7
commit
93bf7cbc59
|
@ -1050,7 +1050,7 @@ void CGameContext::AttemptJoinTeam(int ClientId, int Team)
|
|||
"This team is locked using /lock. Only members of the team can unlock it using /lock." :
|
||||
"This team is locked using /lock. Only members of the team can invite you or unlock it using /lock.");
|
||||
}
|
||||
else if(Team > 0 && Team < MAX_CLIENTS && m_pController->Teams().Count(Team) >= g_Config.m_SvMaxTeamSize && !m_pController->Teams().TeamFlock(Team))
|
||||
else if(Team > 0 && Team < MAX_CLIENTS && m_pController->Teams().Count(Team) >= g_Config.m_SvMaxTeamSize && !m_pController->Teams().TeamFlock(Team) && !m_pController->Teams().IsPractice(Team))
|
||||
{
|
||||
char aBuf[512];
|
||||
str_format(aBuf, sizeof(aBuf), "This team already has the maximum allowed size of %d players", g_Config.m_SvMaxTeamSize);
|
||||
|
|
|
@ -1106,6 +1106,15 @@ void CGameTeams::OnCharacterDeath(int ClientId, int Weapon)
|
|||
|
||||
if(Count(Team) > 1)
|
||||
{
|
||||
// Disband team if the team has more players than allowed.
|
||||
if(Count(Team) > g_Config.m_SvMaxTeamSize)
|
||||
{
|
||||
GameServer()->SendChatTeam(Team, "This team was disbanded because there are more players than allowed in the team.");
|
||||
SetTeamLock(Team, false);
|
||||
KillTeam(Team, Weapon == WEAPON_SELF ? ClientId : -1, ClientId);
|
||||
return;
|
||||
}
|
||||
|
||||
KillTeam(Team, Weapon == WEAPON_SELF ? ClientId : -1, ClientId);
|
||||
|
||||
char aBuf[512];
|
||||
|
|
Loading…
Reference in a new issue