diff --git a/rehlds/HLTV/Director/src/Director.cpp b/rehlds/HLTV/Director/src/Director.cpp index eae4092..b21db92 100644 --- a/rehlds/HLTV/Director/src/Director.cpp +++ b/rehlds/HLTV/Director/src/Director.cpp @@ -372,7 +372,7 @@ float Director::AddBestGenericCut() float sumTarget2Rank[MAX_CLIENTS]; float bestTarget2Rank, bestRank = 0; float targetRankSum = 0; - int newTarget, newTarget2; + int newTarget = 0, newTarget2 = 0; int bestTarget2; for (int i = 0; i < MAX_CLIENTS; i++) diff --git a/rehlds/HLTV/Proxy/src/Proxy.cpp b/rehlds/HLTV/Proxy/src/Proxy.cpp index 5aed7ad..26794dc 100644 --- a/rehlds/HLTV/Proxy/src/Proxy.cpp +++ b/rehlds/HLTV/Proxy/src/Proxy.cpp @@ -100,16 +100,19 @@ void Proxy::AddNextWorld() } nextWorld->RegisterListener(this); - + m_Worlds.AddTail(nextWorld); - m_Server->SetWorld(nextWorld); - if (m_Server->IsConnected()) { - m_Server->Reconnect(); - } + if (m_DemoClient.IsActive()) { - m_DemoClient.Reconnect(); - m_DemoClient.SetWorld(nextWorld); + m_DemoClient.FinishDemo(); + } + + m_Server->SetWorld(nextWorld); + m_DemoClient.SetWorld(nextWorld); + + if (m_Server->IsConnected()) { + m_Server->Reconnect(); } } #endif