From 74bb32779921c5efa38187d7b1760932c02763d5 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Wed, 4 Sep 2024 10:07:01 +0800 Subject: [PATCH] Do not force scoreboard open when the game is paused If the game is paused and a player joins a server (sv_tournament_mode 0) The scoreboard will be forced open. Unless the client configured cl_scoreboard_on_death 0. This can be quite annoying. Especially in the brand new 0.7 feature where users can pause the game. Oy realized that this is a problem 12 year ago: https://github.com/teeworlds/teeworlds/commit/aec468a3c455872c208d999c65a38fc996567bbf#diff-e0ff7a1d6079610adb64fc89fbfff23a381ed92f268d8fe188731a9e0c323b0aR389-R390 For ddnet servers this would mostly affect tournaments where paused games are used to give everyone enough time to download the map. A open scoreboard also blocks broadcasts. So new users might miss the admin announcements explaining why the game is paused. --- src/game/client/components/scoreboard.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/game/client/components/scoreboard.cpp b/src/game/client/components/scoreboard.cpp index 2170c1815..33d2fd452 100644 --- a/src/game/client/components/scoreboard.cpp +++ b/src/game/client/components/scoreboard.cpp @@ -797,15 +797,16 @@ bool CScoreboard::Active() const if(m_Active) return true; + const CNetObj_GameInfo *pGameInfoObj = GameClient()->m_Snap.m_pGameInfoObj; if(GameClient()->m_Snap.m_pLocalInfo && !GameClient()->m_Snap.m_SpecInfo.m_Active) { - // we are not a spectator, check if we are dead - if(!GameClient()->m_Snap.m_pLocalCharacter && g_Config.m_ClScoreboardOnDeath) + // we are not a spectator, check if we are dead and the game isn't paused + if(!GameClient()->m_Snap.m_pLocalCharacter && g_Config.m_ClScoreboardOnDeath && + !(pGameInfoObj && pGameInfoObj->m_GameStateFlags & GAMESTATEFLAG_PAUSED)) return true; } // if the game is over - const CNetObj_GameInfo *pGameInfoObj = GameClient()->m_Snap.m_pGameInfoObj; if(pGameInfoObj && pGameInfoObj->m_GameStateFlags & GAMESTATEFLAG_GAMEOVER) return true;