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.
This commit is contained in:
Bill Currie 2002-03-15 07:35:22 +00:00
parent 0a90ddc51f
commit bde0f94d1a
2 changed files with 4 additions and 0 deletions

View file

@ -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));

View file

@ -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);