Made DemoFileReader::ReadUserCmd return length of usercmd instead of sequence number
This commit is contained in:
parent
803db77e49
commit
05d1518653
|
@ -60,15 +60,10 @@ void DemoFileReader::ReadCmdHeader(unsigned char& cmd, int32_t& tick)
|
|||
}
|
||||
}
|
||||
|
||||
int32_t DemoFileReader::ReadUserCmd(uint8_t* buffer, int32_t length)
|
||||
int32_t DemoFileReader::ReadUserCmd(int32_t& sequenceNum, uint8_t* buffer, int32_t length)
|
||||
{
|
||||
int32_t sequenceNum;
|
||||
fread(&sequenceNum, sizeof(int32_t), 1, m_demoFp);
|
||||
if (ReadRawData(buffer, length) < 0)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
return sequenceNum;
|
||||
return ReadRawData(buffer, length);
|
||||
}
|
||||
|
||||
// DemoFileWriter
|
||||
|
|
|
@ -17,7 +17,7 @@ public:
|
|||
void ReadSequenceInfo(int32_t& seqNum1, int32_t& seqNum2);
|
||||
void ReadCmdInfo(democmdinfo_t& info);
|
||||
void ReadCmdHeader(unsigned char& cmd, int32_t& tick);
|
||||
int32_t ReadUserCmd(uint8_t* buffer, int32_t length);
|
||||
int32_t ReadUserCmd(int32_t& sequenceNum, uint8_t* buffer, int32_t length);
|
||||
|
||||
private:
|
||||
FILE* m_demoFp;
|
||||
|
|
|
@ -136,7 +136,10 @@ void DemoReader::ProcessDem(void* inputFp, IDemoWriter* writer)
|
|||
reader.ReadRawData(nullptr, 1024);
|
||||
break;
|
||||
case dem_usercmd:
|
||||
reader.ReadUserCmd(buffer.data(), 256);
|
||||
{
|
||||
int32_t sequenceNum;
|
||||
reader.ReadUserCmd(sequenceNum, buffer.get(), 256);
|
||||
}
|
||||
break;
|
||||
case dem_datatables:
|
||||
// TODO: datatables
|
||||
|
|
Loading…
Reference in New Issue
Block a user