fixed infinite loop when playing empty demo. Closes #248

This commit is contained in:
oy 2010-10-31 18:51:05 +01:00
parent 9e39239ce2
commit 039de7e1ac

View file

@ -406,7 +406,13 @@ void CDemoPlayer::DoTick()
{
// stop on error or eof
m_pConsole->Print(IConsole::OUTPUT_LEVEL_ADDINFO, "demo_player", "end of file");
Pause();
if(m_Info.m_PreviousTick == -1)
{
m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "demo_player", "empty demo");
Stop();
}
else
Pause();
break;
}