Licht cleanup

* Removed unnecessary header files.
* Removed unnecessary c-string cast.
* Use lock_guard for mutex.
This commit is contained in:
Kawe Mazidjatari 2022-08-29 03:03:53 +02:00
parent e174cb2b1d
commit 73ff0bd0c1
2 changed files with 2 additions and 7 deletions

View File

@ -32,11 +32,8 @@ History:
#include "networksystem/pylon.h"
#include "networksystem/listmanager.h"
#include "squirrel/sqinit.h"
#include "squirrel/sqapi.h"
#include "client/vengineclient_impl.h"
#include "vpc/keyvalues.h"
#include "vstdlib/callback.h"
#include "vpklib/packedstore.h"
#include "gameui/IBrowser.h"
#include "public/edict.h"
@ -669,7 +666,7 @@ void CBrowser::SettingsPanel(void)
ImGui::InputTextWithHint("Hostname", "Matchmaking Server String", &m_szMatchmakingHostName);
if (ImGui::Button("Update Hostname"))
{
ProcessCommand(fmt::format("{:s} \"{:s}\"", "pylon_matchmaking_hostname", m_szMatchmakingHostName.c_str()).c_str());
ProcessCommand(fmt::format("{:s} \"{:s}\"", "pylon_matchmaking_hostname", m_szMatchmakingHostName).c_str());
}
ImGui::InputText("Netkey", const_cast<char*>(g_svNetKey.c_str()), ImGuiInputTextFlags_ReadOnly);
if (ImGui::Button("Regenerate Encryption Key"))

View File

@ -22,7 +22,6 @@ History:
#include "windows/console.h"
#include "windows/resource.h"
#include "gameui/IConsole.h"
#include "client/vengineclient_impl.h"
//-----------------------------------------------------------------------------
// Purpose:
@ -617,7 +616,7 @@ void CConsole::BuildSummary(string svConVar)
//-----------------------------------------------------------------------------
void CConsole::ClampLogSize(void)
{
m_Mutex.lock();
std::lock_guard<std::mutex> l(m_Mutex);
if (m_Logger.GetTotalLines() > con_max_size_logvector->GetInt())
{
while (m_Logger.GetTotalLines() > con_max_size_logvector->GetInt())
@ -630,7 +629,6 @@ void CConsole::ClampLogSize(void)
m_Logger.MoveCursor(m_nSelectBack, false);
m_nSelectBack = 0;
}
m_Mutex.unlock();
}
//-----------------------------------------------------------------------------