From d96d5e5d37835ff0703df203274c1e764ec6661a Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 3 Sep 2016 20:49:23 +0200 Subject: [PATCH] Make sure to send correctly encoded ping values --- qcsrc/server/g_world.qc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index e3bc70697..fe7822bc1 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -56,9 +56,9 @@ void PingPLReport_Think(entity this) { WriteHeader(MSG_BROADCAST, TE_CSQC_PINGPLREPORT); WriteByte(MSG_BROADCAST, this.cnt); - WriteShort(MSG_BROADCAST, max(1, e.ping)); - WriteByte(MSG_BROADCAST, ceil(e.ping_packetloss * 255)); - WriteByte(MSG_BROADCAST, ceil(e.ping_movementloss * 255)); + WriteShort(MSG_BROADCAST, bound(1, e.ping, 65535)); + WriteByte(MSG_BROADCAST, min(ceil(e.ping_packetloss * 255), 255)); + WriteByte(MSG_BROADCAST, min(ceil(e.ping_movementloss * 255), 255)); // record latency times for clients throughout the match so we can report it to playerstats if(time > (e.latency_time + LATENCY_THINKRATE)) -- 2.39.2