From 5d6cf48687688e6083d19e868b13c71af45976c0 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 28 Dec 2024 01:40:59 +0300 Subject: [PATCH] engine: client: fix lightstyle timings on GoldSrc protocol, share the parser with Quake protocol handler --- engine/client/cl_parse.c | 4 ++-- engine/client/cl_qparse.c | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/engine/client/cl_parse.c b/engine/client/cl_parse.c index c0706dc0..9d3bc3cc 100644 --- a/engine/client/cl_parse.c +++ b/engine/client/cl_parse.c @@ -1325,11 +1325,11 @@ void CL_ParseLightStyle( sizebuf_t *msg, connprotocol_t proto ) { int style; const char *s; - float f = 0.0f; + float f = cl.mtime[0]; style = MSG_ReadByte( msg ); s = MSG_ReadString( msg ); - if( proto != PROTO_GOLDSRC ) + if( proto != PROTO_GOLDSRC && proto != PROTO_QUAKE ) f = MSG_ReadFloat( msg ); CL_SetLightstyle( style, s, f ); diff --git a/engine/client/cl_qparse.c b/engine/client/cl_qparse.c index 57b6ae90..b294bfa8 100644 --- a/engine/client/cl_qparse.c +++ b/engine/client/cl_qparse.c @@ -970,9 +970,7 @@ void CL_ParseQuakeMessage( sizebuf_t *msg ) CL_ParseQuakeServerInfo( msg ); break; case svc_lightstyle: - param1 = MSG_ReadByte( msg ); - str = MSG_ReadString( msg ); - CL_SetLightstyle( param1, str, cl.mtime[0] ); + CL_ParseLightStyle( msg, PROTO_QUAKE ); break; case svc_updatename: param1 = MSG_ReadByte( msg );