From 7bffd000c18d2915bc3c127cf060016400274cb8 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Tue, 6 Apr 2021 01:23:29 +1000 Subject: [PATCH] Change all the WriteShort bounds from max 65535 to 32767 --- qcsrc/client/view.qc | 2 +- qcsrc/common/mapobjects/func/rainsnow.qc | 2 +- qcsrc/common/mapobjects/models.qc | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 8b1314663..110ccdc86 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -401,7 +401,7 @@ void fpscounter_update() int channel = MSG_C2S; WriteHeader(channel, fpsreport); - WriteShort(channel, bound(0, rint(fps), 65535)); // prevent insane fps values + WriteShort(channel, bound(0, rint(fps), 32767)); // prevent insane fps values } } diff --git a/qcsrc/common/mapobjects/func/rainsnow.qc b/qcsrc/common/mapobjects/func/rainsnow.qc index 4f4d4d0ac..de49f1e36 100644 --- a/qcsrc/common/mapobjects/func/rainsnow.qc +++ b/qcsrc/common/mapobjects/func/rainsnow.qc @@ -13,7 +13,7 @@ bool rainsnow_SendEntity(entity this, entity to, float sf) WriteShort(MSG_ENTITY, compressShortVector(this.dest)); WriteShort(MSG_ENTITY, this.count); WriteByte(MSG_ENTITY, this.cnt); - WriteShort(MSG_ENTITY, bound(0, this.fade_end, 65535)); + WriteShort(MSG_ENTITY, bound(0, this.fade_end, 32767)); return true; } diff --git a/qcsrc/common/mapobjects/models.qc b/qcsrc/common/mapobjects/models.qc index 4d4ccc8dd..85a8ab843 100644 --- a/qcsrc/common/mapobjects/models.qc +++ b/qcsrc/common/mapobjects/models.qc @@ -116,9 +116,9 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf) if(sf & 0x80) { WriteShort(MSG_ENTITY, this.lodmodelindex0); - WriteShort(MSG_ENTITY, bound(0, this.loddistance1, 65535)); + WriteShort(MSG_ENTITY, bound(0, this.loddistance1, 32767)); WriteShort(MSG_ENTITY, this.lodmodelindex1); - WriteShort(MSG_ENTITY, bound(0, this.loddistance2, 65535)); + WriteShort(MSG_ENTITY, bound(0, this.loddistance2, 32767)); WriteShort(MSG_ENTITY, this.lodmodelindex2); } else @@ -140,8 +140,8 @@ bool g_clientmodel_genericsendentity(entity this, entity to, int sf) WriteVector(MSG_ENTITY, this.movedir); WriteByte(MSG_ENTITY, floor(this.lip * 255)); } - WriteShort(MSG_ENTITY, bound(0, this.fade_start, 65535)); - WriteShort(MSG_ENTITY, bound(0, this.fade_end, 65535)); + WriteShort(MSG_ENTITY, bound(0, this.fade_start, 32767)); + WriteShort(MSG_ENTITY, bound(0, this.fade_end, 32767)); WriteByte(MSG_ENTITY, floor(this.alpha_max * 256)); WriteByte(MSG_ENTITY, floor(this.alpha_min * 256)); WriteByte(MSG_ENTITY, this.inactive); -- 2.39.2