Browse Source

engine: client: fix DT_TIMEWINDOW_* signedness

pull/2/head
Velaron 3 years ago committed by a1batross
parent
commit
0e286f31c5
  1. 6
      engine/common/net_encode.c

6
engine/common/net_encode.c

@ -1333,7 +1333,7 @@ qboolean Delta_ReadField( sizebuf_t *msg, delta_t *pField, void *from, void *to,
{ {
bSigned = true; // timewindow is always signed bSigned = true; // timewindow is always signed
iValue = MSG_ReadBitLong( msg, pField->bits, bSigned ); iValue = MSG_ReadBitLong( msg, pField->bits, bSigned );
flTime = (timebase * 100.0 - iValue) / 100.0; flTime = (timebase * 100.0 - (int)iValue) / 100.0;
*(float *)((byte *)to + pField->offset ) = flTime; *(float *)((byte *)to + pField->offset ) = flTime;
} }
@ -1343,9 +1343,9 @@ qboolean Delta_ReadField( sizebuf_t *msg, delta_t *pField, void *from, void *to,
iValue = MSG_ReadBitLong( msg, pField->bits, bSigned ); iValue = MSG_ReadBitLong( msg, pField->bits, bSigned );
if( !Q_equal( pField->multiplier, 1.0 ) ) if( !Q_equal( pField->multiplier, 1.0 ) )
flTime = ( timebase * pField->multiplier - iValue ) / pField->multiplier; flTime = ( timebase * pField->multiplier - (int)iValue ) / pField->multiplier;
else else
flTime = timebase - iValue; flTime = timebase - (int)iValue;
*(float *)((byte *)to + pField->offset ) = flTime; *(float *)((byte *)to + pField->offset ) = flTime;
} }

Loading…
Cancel
Save