clamp roundTripTime

This commit is contained in:
Lee Salzman 2020-04-03 03:48:38 -04:00
parent 6537dc81f3
commit b4c427059a

View file

@ -852,6 +852,7 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer *
return 0; return 0;
roundTripTime = ENET_TIME_DIFFERENCE (host -> serviceTime, receivedSentTime); roundTripTime = ENET_TIME_DIFFERENCE (host -> serviceTime, receivedSentTime);
roundTripTime = ENET_MAX (roundTripTime, 1);
enet_peer_throttle (peer, roundTripTime); enet_peer_throttle (peer, roundTripTime);