From d054782693533e83d9e13df5e40f65a571ece3ba Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 22 Jun 2024 07:29:16 +0300 Subject: [PATCH] engine: client: fix broken legacy demos playing Fixes: ff4221fbe734 ("engine: client: write correct cls.legacymode/net_protocol value for demos") --- engine/client/cl_demo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/engine/client/cl_demo.c b/engine/client/cl_demo.c index 92ce21a3..34626246 100644 --- a/engine/client/cl_demo.c +++ b/engine/client/cl_demo.c @@ -1577,9 +1577,11 @@ void CL_PlayDemo_f( void ) FS_Seek( cls.demofile, demo.entry->offset, SEEK_SET ); - cls.legacymode = CL_GetProtocolFromDemo( demo.header.net_protocol ); CL_DemoStartPlayback( DEMO_XASH3D ); + // must be after DemoStartPlayback, as CL_Disconnect_f resets the protocol + cls.legacymode = CL_GetProtocolFromDemo( demo.header.net_protocol ); + // g-cont. is this need? Q_strncpy( cls.servername, demoname, sizeof( cls.servername ));