From e277131cf875ba4dfa75871d4a278b0495ce559e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Fri, 12 Jul 2024 21:37:33 +0200 Subject: [PATCH] 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. --- src/game/client/components/scoreboard.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index 1f7cc124b..fd65cf74f 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -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;