From 6cc85bdcc0229732df3cfbd8dd056ca7cad30c12 Mon Sep 17 00:00:00 2001 From: oy Date: Sat, 5 Jan 2019 14:50:34 +0100 Subject: [PATCH] prevent that you can switch to spectators when teams are locked. #1948 --- src/game/client/components/menus_ingame.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index 935ebc722..adc86a2a5 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -30,15 +30,15 @@ void CMenus::GetSwitchTeamInfo(CSwitchTeamInfo *pInfo) pInfo->m_AllowSpec = true; pInfo->m_TimeLeft = 0; - if(TeamMod + m_pClient->m_GameInfo.m_aTeamSize[TEAM_RED] + m_pClient->m_GameInfo.m_aTeamSize[TEAM_BLUE] >= m_pClient->m_ServerSettings.m_PlayerSlots) - { - str_format(pInfo->m_aNotification, sizeof(pInfo->m_aNotification), Localize("Only %d active players are allowed"), m_pClient->m_ServerSettings.m_PlayerSlots); - } - else if(m_pClient->m_ServerSettings.m_TeamLock) + if(m_pClient->m_ServerSettings.m_TeamLock) { str_copy(pInfo->m_aNotification, Localize("Teams are locked"), sizeof(pInfo->m_aNotification)); pInfo->m_AllowSpec = false; } + else if(TeamMod + m_pClient->m_GameInfo.m_aTeamSize[TEAM_RED] + m_pClient->m_GameInfo.m_aTeamSize[TEAM_BLUE] >= m_pClient->m_ServerSettings.m_PlayerSlots) + { + str_format(pInfo->m_aNotification, sizeof(pInfo->m_aNotification), Localize("Only %d active players are allowed"), m_pClient->m_ServerSettings.m_PlayerSlots); + } else if(m_pClient->m_TeamCooldownTick + 1 >= Client()->GameTick()) { pInfo->m_TimeLeft = (m_pClient->m_TeamCooldownTick - Client()->GameTick()) / Client()->GameTickSpeed() + 1;