diff --git a/src/core/logger.cpp b/src/core/logger.cpp index a6f56d88..53c0dce0 100644 --- a/src/core/logger.cpp +++ b/src/core/logger.cpp @@ -1,4 +1,7 @@ #include "tier0/utility.h" +#ifndef _TOOLS +#include "tier0/commandline.h" +#endif // !_TOOLS #include "init.h" #include "logdef.h" #include "logger.h" @@ -320,10 +323,12 @@ void EngineLoggerSink(LogType_t logType, LogLevel_t logLevel, eDLL_T context, if (exitCode) // Terminate the process if an exit code was passed. { - if (MessageBoxA(NULL, Format("%s- %s", pszUpTime, formatted.c_str()).c_str(), - "SDK Error", MB_ICONERROR | MB_OK)) +#ifndef _TOOLS + if (!CommandLine()->CheckParm("-nomessagebox")) +#endif // !_TOOLS { - TerminateProcess(GetCurrentProcess(), exitCode); + MessageBoxA(NULL, Format("%s- %s", pszUpTime, formatted.c_str()).c_str(), "SDK Error", MB_ICONERROR | MB_OK); } + TerminateProcess(GetCurrentProcess(), exitCode); } } diff --git a/src/tier2/crashreporter.cpp b/src/tier2/crashreporter.cpp index 94f16afd..005150ae 100644 --- a/src/tier2/crashreporter.cpp +++ b/src/tier2/crashreporter.cpp @@ -5,6 +5,7 @@ //=============================================================================// #include "tier0/crashhandler.h" #include "tier0/cpu.h" +#include "tier0/commandline.h" #include "tier2/curlutils.h" #include "tier2/crashreporter.h" @@ -69,7 +70,8 @@ static inline string CrashReporter_FormatAttributes(const CCrashHandler* const h void CrashReporter_SubmitToCollector(const CCrashHandler* const handler) { - handler->CreateMessageProcess(); + if (!CommandLine()->CheckParm("-nomessagebox")) + handler->CreateMessageProcess(); if (!CrashReporter_ShouldSubmitReport()) return;