From a08f5e439dec6b56fc83433a480abe1c5f8a68ad Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Fri, 19 Apr 2024 01:49:37 +0300 Subject: [PATCH] engine: common: net_encode: fix comparing DT_TIMEWINDOW_* fields Fixes: 35783bcec241 ("engine: common: net_encode: fix inaccuracy in DT_TIMEWINDOW_* encoding") --- engine/common/net_encode.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/common/net_encode.c b/engine/common/net_encode.c index 24fa520d..00141f41 100644 --- a/engine/common/net_encode.c +++ b/engine/common/net_encode.c @@ -1079,15 +1079,15 @@ static qboolean Delta_CompareField( delta_t *pField, void *from, void *to, doubl { val_a = *(float *)((byte *)from + pField->offset ); val_b = *(float *)((byte *)to + pField->offset ); - fromF = Q_rint(( timebase - val_a ) * 100.0 ); - toF = Q_rint(( timebase - val_b ) * 100.0 ); + fromF = Q_rint( val_a * 100.0 ); + toF = Q_rint( val_b * 100.0 ); } else if( pField->flags & DT_TIMEWINDOW_BIG ) { val_a = *(float *)((byte *)from + pField->offset ); val_b = *(float *)((byte *)to + pField->offset ); - fromF = Q_rint(( timebase - val_a ) * pField->multiplier ); - toF = Q_rint(( timebase - val_b ) * pField->multiplier ); + fromF = Q_rint( val_a * pField->multiplier ); + toF = Q_rint( val_b * pField->multiplier ); } else if( pField->flags & DT_STRING ) {