From 6df60bed54f2ed53c91e171057aa4a06a408ddc9 Mon Sep 17 00:00:00 2001 From: Kamay Xutax Date: Mon, 22 Jan 2024 22:08:54 +0100 Subject: [PATCH] Remove network compression on floats --- public/dt_send.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/public/dt_send.cpp b/public/dt_send.cpp index 65af606dee..48f7287b97 100644 --- a/public/dt_send.cpp +++ b/public/dt_send.cpp @@ -375,6 +375,10 @@ SendProp SendPropFloat( { SendProp ret; + // Remove float compression to avoid errors + flags = SPROP_NOSCALE; + nBits = 32; + if ( varProxy == SendProxy_FloatToFloat ) { Assert( sizeofVar == 0 || sizeofVar == 4 ); @@ -425,6 +429,10 @@ SendProp SendPropVector( { SendProp ret; + // Remove float compression to avoid errors + flags = SPROP_NOSCALE; + nBits = 32; + if(varProxy == SendProxy_VectorToVector) { Assert(sizeofVar == sizeof(Vector)); @@ -461,6 +469,10 @@ SendProp SendPropVectorXY( { SendProp ret; + // Remove float compression to avoid errors + flags = SPROP_NOSCALE; + nBits = 32; + if(varProxy == SendProxy_VectorXYToVectorXY) { Assert(sizeofVar == sizeof(Vector)); @@ -538,6 +550,10 @@ SendProp SendPropAngle( Assert(sizeofVar == 4); } + // Remove float compression to avoid errors + flags = SPROP_NOSCALE; + nBits = 32; + if ( nBits == 32 ) flags |= SPROP_NOSCALE; @@ -571,6 +587,10 @@ SendProp SendPropQAngles( Assert(sizeofVar == 4); } + // Remove float compression to avoid errors + flags = SPROP_NOSCALE; + nBits = 32; + if ( nBits == 32 ) flags |= SPROP_NOSCALE;