mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 14:38:18 +00:00
fixed locking of team change buttons when spectator and team balance is enabled and joining a team would unbalance them
This commit is contained in:
parent
4912a0ccf8
commit
f83d88135f
|
@ -114,15 +114,10 @@ void CMenus::RenderGame(CUIRect MainView)
|
|||
int RedTeamSizeNew = m_pClient->m_GameInfo.m_aTeamSize[TEAM_RED];
|
||||
if(Team != TEAM_RED)
|
||||
++RedTeamSizeNew;
|
||||
else if(Team == TEAM_RED)
|
||||
--RedTeamSizeNew;
|
||||
int BlueTeamSizeNew = m_pClient->m_GameInfo.m_aTeamSize[TEAM_BLUE];
|
||||
if(Team != TEAM_BLUE)
|
||||
++BlueTeamSizeNew;
|
||||
else if(Team == TEAM_BLUE)
|
||||
if(Team == TEAM_BLUE)
|
||||
--BlueTeamSizeNew;
|
||||
bool BlockRed = m_pClient->m_ServerSettings.m_TeamBalance && (RedTeamSizeNew - BlueTeamSizeNew >= NUM_TEAMS);
|
||||
bool BlockBlue = m_pClient->m_ServerSettings.m_TeamBalance && (BlueTeamSizeNew - RedTeamSizeNew >= NUM_TEAMS);
|
||||
if((Info.m_aNotification[0] && Team != TEAM_RED) || BlockRed)
|
||||
{
|
||||
if(Info.m_TimeLeft)
|
||||
|
@ -142,6 +137,13 @@ void CMenus::RenderGame(CUIRect MainView)
|
|||
SetActive(false);
|
||||
}
|
||||
|
||||
RedTeamSizeNew = m_pClient->m_GameInfo.m_aTeamSize[TEAM_RED];
|
||||
if(Team == TEAM_RED)
|
||||
--RedTeamSizeNew;
|
||||
BlueTeamSizeNew = m_pClient->m_GameInfo.m_aTeamSize[TEAM_BLUE];
|
||||
if(Team != TEAM_BLUE)
|
||||
++BlueTeamSizeNew;
|
||||
bool BlockBlue = m_pClient->m_ServerSettings.m_TeamBalance && (BlueTeamSizeNew - RedTeamSizeNew >= NUM_TEAMS);
|
||||
if((Info.m_aNotification[0] && Team != TEAM_BLUE) || BlockBlue)
|
||||
{
|
||||
if(Info.m_TimeLeft)
|
||||
|
|
Loading…
Reference in a new issue