Fix undefined behaviour in HSendPacket

This commit is contained in:
NepDisk 2025-12-09 19:26:26 -05:00
parent 3908ba75e0
commit e346443551

View file

@ -1083,7 +1083,8 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
else
netbuffer->ack = acknum;
netbuffer->packetindex = nodes[doomcom->remotenode].sendnum++;
if (node < MAXNETNODES)
netbuffer->packetindex = nodes[doomcom->remotenode].sendnum++;
netbuffer->checksum = NetbufferChecksum();
sendbytes += packetheaderlength + doomcom->datalength; // For stat