From eabe6f484d9f00f48d1253de0dd2db5d076cb7c4 Mon Sep 17 00:00:00 2001
From: bones_was_here <bones_was_here@xa.org.au>
Date: Sun, 28 Feb 2021 15:00:57 +1000
Subject: [PATCH] Prevent negative pings by correctly bounding (it's a signed
 short)

---
 qcsrc/server/world.qc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc
index b766a0c20..3f6e48087 100644
--- a/qcsrc/server/world.qc
+++ b/qcsrc/server/world.qc
@@ -69,7 +69,7 @@ void PingPLReport_Think(entity this)
 	{
 		WriteHeader(MSG_BROADCAST, TE_CSQC_PINGPLREPORT);
 		WriteByte(MSG_BROADCAST, this.cnt);
-		WriteShort(MSG_BROADCAST, bound(1, CS(e).ping, 65535));
+		WriteShort(MSG_BROADCAST, bound(1, CS(e).ping, 32767));
 		WriteByte(MSG_BROADCAST, min(ceil(CS(e).ping_packetloss * 255), 255));
 		WriteByte(MSG_BROADCAST, min(ceil(CS(e).ping_movementloss * 255), 255));
 
-- 
2.39.5