[qw] Check packet size before checking ping ack

Ping ack (A2A_ACK) is always a 1-byte packet, so check that the A2A_ACK
is the only byte in the packet before passing the packet to the server
list code. Fixes the mysterious dropped packet every 256 packets as the
low eight bits of the packet's sequence number equalled A2A_ACK.
This commit is contained in:
Bill Currie 2021-07-11 09:26:05 +09:00
parent 3c0ad2ca71
commit c4ee7ff68a

View file

@ -1028,8 +1028,9 @@ CL_ReadPackets (void)
CL_ConnectionlessPacket ();
continue;
}
if (*(char *) net_message->message->data == A2A_ACK)
{
if (net_message->message->cursize == 1
&& *(char *) net_message->message->data == A2A_ACK) {
Sys_Printf ("ping ack\n");
SL_CheckPing (NET_AdrToString (net_from));
continue;
}