From 897af546cbe1070f6410cd650271d1532a3b30f5 Mon Sep 17 00:00:00 2001 From: Nikita Zyuzin Date: Sun, 14 Jun 2015 14:39:42 +0400 Subject: [PATCH] Fix bug with constant demo autorecording. Fixes #213 It's relevant for states in which new RoundStartTick is sent each second tick --- src/game/client/gameclient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index 5a639e15f..4e2d1bfc2 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -1079,12 +1079,12 @@ void CGameClient::OnNewSnapshot() OnGameOver(); else if(!(CurrentTickGameOver || CurrentTickPaused) // not in game over or pause state && !IsRace(&Info) // and not playing race (race_demo.cpp handles that case) - && (m_Snap.m_pGameInfoObj->m_RoundStartTick != m_LastRoundStartTick // and (new round started + && (m_Snap.m_pGameInfoObj->m_RoundStartTick - m_LastRoundStartTick > 2 // and (round start tick was updated more than 2 ticks ago || (s_GameOver && !CurrentTickGameOver))) // or game was over and now is not over) { - m_LastRoundStartTick = m_Snap.m_pGameInfoObj->m_RoundStartTick; OnStartGame(); } + m_LastRoundStartTick = m_Snap.m_pGameInfoObj->m_RoundStartTick; s_GameOver = CurrentTickGameOver; s_GamePaused = CurrentTickPaused; }