[Debug]: Refactor the crit sections class wrapper

This commit is contained in:
FutureRave
2022-11-21 23:22:52 +00:00
parent d2686071aa
commit 0593d890da
5 changed files with 129 additions and 3 deletions

View File

@ -1,4 +1,5 @@
#include <STDInclude.hpp>
#include "Game/Engine/ScopedCriticalSection.hpp"
namespace Components
{
@ -288,7 +289,7 @@ namespace Components
sprintf_s(newFileName, "%s_%s.log", bug, Game::Live_GetLocalClientName(0));
Game::Sys_EnterCriticalSection(Game::CRITSECT_CONSOLE);
Game::Engine::ScopedCriticalSection _(Game::CRITSECT_CONSOLE, Game::Engine::SCOPED_CRITSECT_NORMAL);
if (*Game::logfile)
{
@ -301,8 +302,6 @@ namespace Components
const auto result = CopyFileA(from_ospath, to_ospath, 0);
Game::Com_OpenLogFile();
Game::Sys_LeaveCriticalSection(Game::CRITSECT_CONSOLE);
if (!result)
{
Logger::PrintError(1, "CopyFile failed({}) {} {}\n", GetLastError(), "console_mp.log", newFileName);