mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Fix crash when loggers are used before detour init
'v_Plat_FloatTime' is only initialized during detour init. Using the loggers before will cause a crash. Code now logs 0.0 when v_Plat_FloatTime is nullptr. Showing 0.0 at this stage is correct as the game dll isn't initialized by then.
This commit is contained in:
parent
b90d6f929c
commit
75ae4d2bcf
@ -26,7 +26,7 @@ uint64_t Plat_MSTime()
|
||||
const char* Plat_GetProcessUpTime()
|
||||
{
|
||||
static char szBuf[4096];
|
||||
sprintf_s(szBuf, sizeof(szBuf), "[%.3f] ", Plat_FloatTime());
|
||||
sprintf_s(szBuf, sizeof(szBuf), "[%.3f] ", v_Plat_FloatTime ? Plat_FloatTime() : 0.0);
|
||||
|
||||
return szBuf;
|
||||
}
|
||||
@ -38,5 +38,5 @@ const char* Plat_GetProcessUpTime()
|
||||
//-----------------------------------------------------------------------------
|
||||
void Plat_GetProcessUpTime(char* szBuf, size_t nSize)
|
||||
{
|
||||
sprintf_s(szBuf, nSize, "[%.3f] ", Plat_FloatTime());
|
||||
sprintf_s(szBuf, nSize, "[%.3f] ", v_Plat_FloatTime ? Plat_FloatTime() : 0.0);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user