From bde113ef56393066601b8d21b6c8ffc9bfea53f2 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Tue, 1 Sep 2020 00:26:10 -0400 Subject: [PATCH] clamp minimum highest RTT variance --- protocol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protocol.c b/protocol.c index 0fc2253..3c805cc 100644 --- a/protocol.c +++ b/protocol.c @@ -890,7 +890,7 @@ enet_protocol_handle_acknowledge (ENetHost * host, ENetEvent * event, ENetPeer * peer -> lastRoundTripTime = peer -> lowestRoundTripTime; peer -> lastRoundTripTimeVariance = ENET_MAX (peer -> highestRoundTripTimeVariance, (peer -> lowestRoundTripTime + 15) / 16); peer -> lowestRoundTripTime = peer -> roundTripTime; - peer -> highestRoundTripTimeVariance = peer -> roundTripTimeVariance; + peer -> highestRoundTripTimeVariance = ENET_MAX (peer -> roundTripTimeVariance, 2); peer -> packetThrottleEpoch = host -> serviceTime; }