mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
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:
commit
24b75d17e9
|
@ -937,7 +937,7 @@ int CDemoPlayer::SetPos(int WantedTick)
|
||||||
m_Info.m_PreviousTick = -1;
|
m_Info.m_PreviousTick = -1;
|
||||||
|
|
||||||
// playback everything until we hit our tick
|
// playback everything until we hit our tick
|
||||||
while(m_Info.m_NextTick < WantedTick)
|
while(m_Info.m_NextTick < WantedTick && IsPlaying())
|
||||||
DoTick();
|
DoTick();
|
||||||
|
|
||||||
Play();
|
Play();
|
||||||
|
@ -976,7 +976,7 @@ int CDemoPlayer::Update(bool RealTime)
|
||||||
{
|
{
|
||||||
m_Info.m_CurrentTime += (int64_t)(Deltatime * (double)m_Info.m_Info.m_Speed);
|
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;
|
int64_t CurtickStart = m_Info.m_Info.m_CurrentTick * Freq / SERVER_TICK_SPEED;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue