Base gentlemen delay on lowest average

Was previously based on the delay at the moment of
calculation, which may fluctuate. I changed it to use the
average because the number was flickering in the HUD.
This commit is contained in:
James R 2024-04-27 04:30:21 -07:00
parent 8103bd21c1
commit 3e5f6466a0

View file

@ -6289,19 +6289,15 @@ static void UpdatePingTable(void)
{
if (playeringame[i] && playernode[i] > 0)
{
if (! server_lagless && playernode[i] > 0 && !players[i].spectator)
{
lag = GetLag(playernode[i]);
realpingtable[i] += lag;
// TicsToMilliseconds can't handle pings over 1000ms lol
realpingtable[i] += GetLag(playernode[i]);
if (!players[i].spectator)
{
lag = playerpingtable[i];
if (! fastest || lag < fastest)
fastest = lag;
}
else
{
// TicsToMilliseconds can't handle pings over 1000ms lol
realpingtable[i] += GetLag(playernode[i]);
}
}
}