]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Prevent negative pings by correctly bounding (it's a signed short)
authorbones_was_here <bones_was_here@xa.org.au>
Sun, 28 Feb 2021 05:00:57 +0000 (15:00 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Sun, 28 Feb 2021 05:00:57 +0000 (15:00 +1000)
qcsrc/server/world.qc

index b766a0c20db9b8708f2a1c418135c30b31e1ec0c..3f6e480874a3cf405ddf04f8492428cc83a11850 100644 (file)
@@ -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));