From bde0f94d1a2b508f6d4bdd2c03e3c8a659fd936b Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 15 Mar 2002 07:35:22 +0000 Subject: [PATCH] don't process server packets when a client packet has been read from a demo file. this was causing server packets to sometimes be processed multiple times. --- qw/source/cl_demo.c | 1 + qw/source/cl_main.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/qw/source/cl_demo.c b/qw/source/cl_demo.c index d2946501b..ea9083c75 100644 --- a/qw/source/cl_demo.c +++ b/qw/source/cl_demo.c @@ -246,6 +246,7 @@ CL_GetDemoMessage (void) switch (c) { case dem_cmd: // user sent input + net_message->message->cursize = -1; i = cls.netchan.outgoing_sequence & UPDATE_MASK; pcmd = &cl.frames[i].cmd; r = Qread (cls.demofile, pcmd, sizeof (*pcmd)); diff --git a/qw/source/cl_main.c b/qw/source/cl_main.c index ec0d67c06..0da84d772 100644 --- a/qw/source/cl_main.c +++ b/qw/source/cl_main.c @@ -1009,6 +1009,9 @@ CL_ReadPackets (void) // while (NET_GetPacket ()) while (CL_GetMessage ()) { + if (net_message->message->cursize == -1) + continue; + if (cls.demoplayback && net_packetlog->int_val) Log_Incoming_Packet(net_message->message->data, net_message->message->cursize);