From 1fccf8386a3cee8a0dfc152ee606ed353d1e6b72 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 3 Jun 2021 22:39:54 +0200 Subject: [PATCH] Properly bound some positive numbers sent via WriteShort --- qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc | 2 +- qcsrc/server/items/items.qc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc index 043ee6853..97c26f360 100644 --- a/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc +++ b/qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc @@ -65,7 +65,7 @@ bool WaypointSprite_SendEntity(entity this, entity to, float sendflags) { WriteCoord(MSG_ENTITY, this.fade_time); WriteCoord(MSG_ENTITY, this.teleport_time); - WriteShort(MSG_ENTITY, this.fade_rate); // maxdist + WriteShort(MSG_ENTITY, bound(0, this.fade_rate, 32767)); // maxdist WriteByte(MSG_ENTITY, hide_flags); } diff --git a/qcsrc/server/items/items.qc b/qcsrc/server/items/items.qc index 403125eea..f0d8e3835 100644 --- a/qcsrc/server/items/items.qc +++ b/qcsrc/server/items/items.qc @@ -54,8 +54,8 @@ bool ItemSend(entity this, entity to, int sf) if(sf & ISF_MODEL) { - WriteShort(MSG_ENTITY, this.fade_end); - WriteShort(MSG_ENTITY, this.fade_start); + WriteShort(MSG_ENTITY, bound(0, this.fade_end, 32767)); + WriteShort(MSG_ENTITY, bound(0, this.fade_start, 32767)); if(this.mdl == "") LOG_TRACE("^1WARNING!^7 this.mdl is unset for item ", this.classname, "expect a crash just about now"); -- 2.39.2