mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
Stop negative tic counts from corrupting messages
This commit is contained in:
parent
42e6737803
commit
c661da2995
2 changed files with 2 additions and 2 deletions
|
@ -1173,7 +1173,7 @@ void NetUpdate (void)
|
||||||
netbuffer[k++] = lowtic;
|
netbuffer[k++] = lowtic;
|
||||||
}
|
}
|
||||||
|
|
||||||
numtics = lowtic - realstart;
|
numtics = MAX(0, lowtic - realstart);
|
||||||
if (numtics > BACKUPTICS)
|
if (numtics > BACKUPTICS)
|
||||||
I_Error ("NetUpdate: Node %d missed too many tics", i);
|
I_Error ("NetUpdate: Node %d missed too many tics", i);
|
||||||
|
|
||||||
|
|
|
@ -208,11 +208,11 @@ void PacketSend (void)
|
||||||
{
|
{
|
||||||
I_FatalError("Netbuffer overflow!");
|
I_FatalError("Netbuffer overflow!");
|
||||||
}
|
}
|
||||||
|
assert(!(doomcom.data[0] & NCMD_COMPRESSED));
|
||||||
|
|
||||||
uLong size = TRANSMIT_SIZE - 1;
|
uLong size = TRANSMIT_SIZE - 1;
|
||||||
if (doomcom.datalength >= 10)
|
if (doomcom.datalength >= 10)
|
||||||
{
|
{
|
||||||
assert(!(doomcom.data[0] & NCMD_COMPRESSED));
|
|
||||||
TransmitBuffer[0] = doomcom.data[0] | NCMD_COMPRESSED;
|
TransmitBuffer[0] = doomcom.data[0] | NCMD_COMPRESSED;
|
||||||
c = compress2(TransmitBuffer + 1, &size, doomcom.data + 1, doomcom.datalength - 1, 9);
|
c = compress2(TransmitBuffer + 1, &size, doomcom.data + 1, doomcom.datalength - 1, 9);
|
||||||
size += 1;
|
size += 1;
|
||||||
|
|
Loading…
Reference in a new issue