Signal to stop reading demo if invalid command is found
This commit is contained in:
parent
2bf16179ad
commit
f5d8d9bbf1
@ -77,13 +77,9 @@ void DemoFileReader::ReadCmdInfo(democmdinfo_t& info)
|
|||||||
void DemoFileReader::ReadCmdHeader(unsigned char& cmd, int32_t& tick)
|
void DemoFileReader::ReadCmdHeader(unsigned char& cmd, int32_t& tick)
|
||||||
{
|
{
|
||||||
FILE* fp = m_demoFp;
|
FILE* fp = m_demoFp;
|
||||||
fread(&cmd, sizeof(unsigned char), 1, fp);
|
fread(&cmd, 1, sizeof(unsigned char), fp);
|
||||||
fread(&tick, sizeof(int32_t), 1, fp);
|
fread(&tick, 1, sizeof(int32_t), fp);
|
||||||
if (cmd >= 0)
|
if (cmd > dem_lastcmd)
|
||||||
{
|
|
||||||
assert(cmd <= dem_lastcmd);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
cmd = dem_stop;
|
cmd = dem_stop;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user