engine: client: fix lightstyle timings on GoldSrc protocol, share the parser with Quake protocol handler

This commit is contained in:
Alibek Omarov 2024-12-28 01:40:59 +03:00
parent 88949a9ee6
commit 5d6cf48687
2 changed files with 3 additions and 5 deletions

View file

@ -1325,11 +1325,11 @@ void CL_ParseLightStyle( sizebuf_t *msg, connprotocol_t proto )
{ {
int style; int style;
const char *s; const char *s;
float f = 0.0f; float f = cl.mtime[0];
style = MSG_ReadByte( msg ); style = MSG_ReadByte( msg );
s = MSG_ReadString( msg ); s = MSG_ReadString( msg );
if( proto != PROTO_GOLDSRC ) if( proto != PROTO_GOLDSRC && proto != PROTO_QUAKE )
f = MSG_ReadFloat( msg ); f = MSG_ReadFloat( msg );
CL_SetLightstyle( style, s, f ); CL_SetLightstyle( style, s, f );

View file

@ -970,9 +970,7 @@ void CL_ParseQuakeMessage( sizebuf_t *msg )
CL_ParseQuakeServerInfo( msg ); CL_ParseQuakeServerInfo( msg );
break; break;
case svc_lightstyle: case svc_lightstyle:
param1 = MSG_ReadByte( msg ); CL_ParseLightStyle( msg, PROTO_QUAKE );
str = MSG_ReadString( msg );
CL_SetLightstyle( param1, str, cl.mtime[0] );
break; break;
case svc_updatename: case svc_updatename:
param1 = MSG_ReadByte( msg ); param1 = MSG_ReadByte( msg );