From 0178d74f4218fd75ac308c1ecf6809f15b2a1f9f Mon Sep 17 00:00:00 2001 From: Garey Akhmetshin Date: Mon, 15 Feb 2021 14:57:37 +0500 Subject: [PATCH] Reconnect democlient with new delayed world system cause twice stop demo. --- rehlds/HLTV/Proxy/src/Proxy.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/rehlds/HLTV/Proxy/src/Proxy.cpp b/rehlds/HLTV/Proxy/src/Proxy.cpp index 26794dc..98e2275 100644 --- a/rehlds/HLTV/Proxy/src/Proxy.cpp +++ b/rehlds/HLTV/Proxy/src/Proxy.cpp @@ -1918,8 +1918,14 @@ void Proxy::ReconnectClients() client->Reconnect(); client = (IClient *)m_Clients.GetNext(); } - - m_DemoClient.Reconnect(); +#ifdef HLTV_FIXES + // If delay set than m_DemoClient is already stopped demo in AddNextWorld + // Reconnect (Stoping demo) in this case will stop demo and write new one with lost frames + if (m_ClientDelay <= 0 && m_DemoClient.IsActive()) +#endif + { + m_DemoClient.Reconnect(); + } } void Proxy::CMD_OffLineText(char *cmdLine)