r5sdk/r5dev/engine/sys_dll.cpp
Kawe Mazidjatari 2010e11310 Add 'fatal' functionality to Error()
When fatal is set, the function will show a error dialogue, which will halt the process and close when the message is dismissed. Else we will end up in a crash.
2022-08-22 12:42:41 +02:00

29 lines
894 B
C++

#include "core/stdafx.h"
#include "engine/sys_dll.h"
//-----------------------------------------------------------------------------
// Sys_Error_Internal
//
//-----------------------------------------------------------------------------
int HSys_Error_Internal(char* fmt, va_list args)
{
char buffer[2048]{};
Error(eDLL_T::COMMON, false, "_______________________________________________________________\n");
Error(eDLL_T::COMMON, false, "] ENGINE ERROR ################################################\n");
vsprintf(buffer, fmt, args);
Error(eDLL_T::COMMON, false, "%s\n", buffer);
///////////////////////////////////////////////////////////////////////////
return Sys_Error_Internal(fmt, args);
}
void SysDll_Attach()
{
DetourAttach((LPVOID*)&Sys_Error_Internal, &HSys_Error_Internal);
}
void SysDll_Detach()
{
DetourDetach((LPVOID*)&Sys_Error_Internal, &HSys_Error_Internal);
}