mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Fix incorrect scoreboard size if blue team used without teams flag
When `GAMEFLAG_TEAMS` is not set, only the players of the red team are rendered in the scoreboard, but the size of the scoreboard was incorrectly calculated based on the size of the larger team (red or blue), which should only be done when `GAMEFLAG_TEAMS` is set.
This commit is contained in:
parent
a21ff5b72e
commit
e277131cf8
|
@ -561,7 +561,8 @@ void CScoreboard::OnRender()
|
|||
|
||||
const CNetObj_GameInfo *pGameInfoObj = GameClient()->m_Snap.m_pGameInfoObj;
|
||||
const bool Teams = pGameInfoObj && (pGameInfoObj->m_GameFlags & GAMEFLAG_TEAMS);
|
||||
const int NumPlayers = maximum(GameClient()->m_Snap.m_aTeamSize[TEAM_RED], GameClient()->m_Snap.m_aTeamSize[TEAM_BLUE]);
|
||||
const auto &aTeamSize = GameClient()->m_Snap.m_aTeamSize;
|
||||
const int NumPlayers = Teams ? maximum(aTeamSize[TEAM_RED], aTeamSize[TEAM_BLUE]) : aTeamSize[TEAM_RED];
|
||||
|
||||
const float ScoreboardSmallWidth = 750.0f + 20.0f;
|
||||
const float ScoreboardWidth = !Teams && NumPlayers <= 16 ? ScoreboardSmallWidth : 1500.0f;
|
||||
|
|
Loading…
Reference in a new issue