From b06015835ced05809cc4897b41afe6f631bb9f86 Mon Sep 17 00:00:00 2001 From: Jordan Cristiano Date: Sun, 14 Jun 2015 17:21:34 -0400 Subject: [PATCH] Fixed demo writer writing empty packets --- demboyz/demowriter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/demboyz/demowriter.cpp b/demboyz/demowriter.cpp index 2129dbd..62f1233 100644 --- a/demboyz/demowriter.cpp +++ b/demboyz/demowriter.cpp @@ -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)