2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-12-24 01:35:24 +01:00

engine: client: fix svc_event parsing

This commit is contained in:
Alibek Omarov 2024-10-15 06:07:06 +03:00
parent 5402a9611e
commit 6b1c283082

View File

@ -422,14 +422,12 @@ void CL_ParseEvent( sizebuf_t *msg, connprotocol_t proto )
int event_index;
int i, num_events;
int packet_index;
event_args_t nullargs, args;
const event_args_t nullargs = { 0 };
event_args_t args = { 0 };
entity_state_t *state;
float delay;
int entity_bits;
memset( &nullargs, 0, sizeof( nullargs ));
memset( &args, 0, sizeof( args ));
num_events = MSG_ReadUBitLong( msg, 5 );
if( proto == PROTO_GOLDSRC )
@ -443,16 +441,18 @@ void CL_ParseEvent( sizebuf_t *msg, connprotocol_t proto )
{
event_index = MSG_ReadUBitLong( msg, MAX_EVENT_BITS );
if( MSG_ReadOneBit( msg ))
packet_index = MSG_ReadUBitLong( msg, entity_bits );
else packet_index = -1;
if( MSG_ReadOneBit( msg ))
{
if( proto == PROTO_GOLDSRC )
Delta_ReadGSFields( msg, DT_EVENT_T, &nullargs, &args, 0.0f );
else MSG_ReadDeltaEvent( msg, &nullargs, &args );
packet_index = MSG_ReadUBitLong( msg, entity_bits );
if( MSG_ReadOneBit( msg ))
{
if( proto == PROTO_GOLDSRC )
Delta_ReadGSFields( msg, DT_EVENT_T, &nullargs, &args, 0.0f );
else MSG_ReadDeltaEvent( msg, &nullargs, &args );
}
}
else packet_index = -1;
if( MSG_ReadOneBit( msg ))
delay = (float)MSG_ReadWord( msg ) * (1.0f / 100.0f);