mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-29 16:24:16 +00:00
engine: net_encode: remove naive clientdata/weapondata copy, only copy fields explicitly listed in deltalst
This commit is contained in:
parent
6e4ab74694
commit
ea5937bce0
@ -1605,6 +1605,7 @@ void MSG_ReadClientData( sizebuf_t *msg, clientdata_t *from, clientdata_t *to, d
|
|||||||
delta_t *pField;
|
delta_t *pField;
|
||||||
delta_info_t *dt;
|
delta_info_t *dt;
|
||||||
int i;
|
int i;
|
||||||
|
qboolean noChanges;
|
||||||
|
|
||||||
dt = Delta_FindStruct( "clientdata_t" );
|
dt = Delta_FindStruct( "clientdata_t" );
|
||||||
Assert( dt && dt->bInitialized );
|
Assert( dt && dt->bInitialized );
|
||||||
@ -1612,15 +1613,14 @@ void MSG_ReadClientData( sizebuf_t *msg, clientdata_t *from, clientdata_t *to, d
|
|||||||
pField = dt->pFields;
|
pField = dt->pFields;
|
||||||
Assert( pField != NULL );
|
Assert( pField != NULL );
|
||||||
|
|
||||||
*to = *from;
|
noChanges = !cls.legacymode && !MSG_ReadOneBit( msg );
|
||||||
|
|
||||||
if( !cls.legacymode && !MSG_ReadOneBit( msg ))
|
|
||||||
return; // we have no changes
|
|
||||||
|
|
||||||
// process fields
|
// process fields
|
||||||
for( i = 0; i < dt->numFields; i++, pField++ )
|
for( i = 0; i < dt->numFields; i++, pField++ )
|
||||||
{
|
{
|
||||||
Delta_ReadField( msg, pField, from, to, timebase );
|
if( noChanges )
|
||||||
|
Delta_CopyField( pField, from, to, timebase );
|
||||||
|
else Delta_ReadField( msg, pField, from, to, timebase );
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -1691,8 +1691,6 @@ void MSG_ReadWeaponData( sizebuf_t *msg, weapon_data_t *from, weapon_data_t *to,
|
|||||||
pField = dt->pFields;
|
pField = dt->pFields;
|
||||||
Assert( pField != NULL );
|
Assert( pField != NULL );
|
||||||
|
|
||||||
*to = *from;
|
|
||||||
|
|
||||||
// process fields
|
// process fields
|
||||||
for( i = 0; i < dt->numFields; i++, pField++ )
|
for( i = 0; i < dt->numFields; i++, pField++ )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user