summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoroy <tom_adams@web.de>2023-06-13 22:33:46 +0200
committerGitHub <noreply@github.com>2023-06-13 22:33:46 +0200
commit1343d1cd0e4cd5b01c6997d1d7ba0734c2dc33b8 (patch)
treeef0066675b059b418b6734c3e3d61a48dfd6a077
parent1c452bf26fff644526aedec4ab0b5a9229bae108 (diff)
parent6fe6907e38a89355f339a910bec2f12abb176f6b (diff)
Merge pull request #3132 from Robyt3/Stats-Hide-Round-End
Fix statboard staying open after round ends
-rw-r--r--src/game/client/components/stats.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/game/client/components/stats.cpp b/src/game/client/components/stats.cpp
index 010aff0d3..17a1bbb72 100644
--- a/src/game/client/components/stats.cpp
+++ b/src/game/client/components/stats.cpp
@@ -132,7 +132,8 @@ void CStats::OnRender()
if(Config()->m_ClAutoStatScreenshot)
{
// on game over, wait three seconds
- if(m_ScreenshotTime < 0 && m_pClient->m_Snap.m_pGameData && m_pClient->m_Snap.m_pGameData->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER)
+ const bool IsGameOver = m_pClient->m_Snap.m_pGameData && m_pClient->m_Snap.m_pGameData->m_GameStateFlags&GAMESTATEFLAG_GAMEOVER;
+ if(m_ScreenshotTime < 0 && IsGameOver)
m_ScreenshotTime = time_get()+time_freq()*3;
// when rendered, take screenshot once
@@ -141,6 +142,9 @@ void CStats::OnRender()
AutoStatScreenshot();
m_ScreenshotTaken = true;
}
+
+ if(!IsGameOver)
+ m_ScreenshotTime = -1;
}
// don't render if menu is open