Fixed demo writer writing empty packets

This commit is contained in:
Jordan Cristiano 2015-06-14 17:21:34 -04:00
parent 4218c60eff
commit b06015835c

View File

@ -61,7 +61,10 @@ void DemoWriter::StartCommandPacket(CommandPacket& packet)
void DemoWriter::EndCommandPacket()
{
m_writer.WriteRawData(m_cmdPacketBuf.GetBasePointer(), m_cmdPacketBuf.GetNumBytesWritten());
if (m_cmdPacketBuf.GetNumBytesWritten() > 0)
{
m_writer.WriteRawData(m_cmdPacketBuf.GetBasePointer(), m_cmdPacketBuf.GetNumBytesWritten());
}
}
void DemoWriter::WriteNetPacket(NetPacket& packet, SourceGameContext& context)