From: bones_was_here Date: Sun, 28 Feb 2021 05:00:57 +0000 (+1000) Subject: Prevent negative pings by correctly bounding (it's a signed short) X-Git-Tag: xonotic-v0.8.5~553^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=eabe6f484d9f00f48d1253de0dd2db5d076cb7c4;p=xonotic%2Fxonotic-data.pk3dir.git Prevent negative pings by correctly bounding (it's a signed short) --- 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));