mirror of
https://github.com/ddnet/ddnet.git
synced 2024-09-20 09:34:19 +00:00
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:
parent
c8d175a6f1
commit
897af546cb
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue