Critical fix to ordered packet system

This commit is contained in:
MysterD 2021-08-10 22:07:02 -07:00
parent 61ed5a774c
commit d9ab09ee64

View file

@ -153,14 +153,14 @@ void network_send_to(u8 localIndex, struct Packet* p) {
p->localIndex = localIndex;
// remember reliable packets
network_remember_reliable(p);
// set ordered data (MUST BE IMMEDITAELY BEFORE HASING+SENDING)
// set ordered data (MUST BE IMMEDITAELY BEFORE network_remember_reliable())
if (p->orderedGroupId != 0 && !p->sent) {
packet_set_ordered_data(p);
}
// remember reliable packets
network_remember_reliable(p);
// save inside packet buffer
u32 hash = packet_hash(p);
memcpy(&p->buffer[p->dataLength], &hash, sizeof(u32));