Fix bug with constant demo autorecording. Fixes #213

It's relevant for states in which new RoundStartTick is sent each second tick
This commit is contained in:
Nikita Zyuzin 2015-06-14 14:39:42 +04:00
parent c8d175a6f1
commit 897af546cb

View file

@ -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;
}