Fix bug with Auth (#478)
This commit is contained in:
parent
7a5e3f3df4
commit
c890b4c8a4
@ -104,12 +104,25 @@ namespace Utils
|
|||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetLegacyEnvironment()
|
||||||
|
{
|
||||||
|
wchar_t binaryPath[512];
|
||||||
|
GetModuleFileNameW(GetModuleHandleW(nullptr), binaryPath, sizeof(binaryPath) / sizeof(wchar_t));
|
||||||
|
|
||||||
|
auto* exeBaseName = std::wcsrchr(binaryPath, L'\\');
|
||||||
|
exeBaseName[0] = L'\0';
|
||||||
|
|
||||||
|
// Make the game work without the xlabs launcher
|
||||||
|
SetCurrentDirectoryW(binaryPath);
|
||||||
|
}
|
||||||
|
|
||||||
void SetEnvironment()
|
void SetEnvironment()
|
||||||
{
|
{
|
||||||
wchar_t* buffer{};
|
wchar_t* buffer{};
|
||||||
std::size_t size{};
|
std::size_t size{};
|
||||||
if (_wdupenv_s(&buffer, &size, L"XLABS_MW2_INSTALL") != 0 || buffer == nullptr)
|
if (_wdupenv_s(&buffer, &size, L"XLABS_MW2_INSTALL") != 0 || buffer == nullptr)
|
||||||
{
|
{
|
||||||
|
SetLegacyEnvironment();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user