Merge pull request #7372 from Robyt3/Engine-Demo-Update-File-Check

Fix use of closed demo file when playback stopped due to error
This commit is contained in:
Dennis Felsing 2023-10-25 22:53:43 +00:00 committed by GitHub
commit 24b75d17e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -937,7 +937,7 @@ int CDemoPlayer::SetPos(int WantedTick)
m_Info.m_PreviousTick = -1;
// playback everything until we hit our tick
while(m_Info.m_NextTick < WantedTick)
while(m_Info.m_NextTick < WantedTick && IsPlaying())
DoTick();
Play();
@ -976,7 +976,7 @@ int CDemoPlayer::Update(bool RealTime)
{
m_Info.m_CurrentTime += (int64_t)(Deltatime * (double)m_Info.m_Info.m_Speed);
while(!m_Info.m_Info.m_Paused)
while(!m_Info.m_Info.m_Paused && IsPlaying())
{
int64_t CurtickStart = m_Info.m_Info.m_CurrentTick * Freq / SERVER_TICK_SPEED;