mirror of
https://github.com/XLabsProject/s1x-client.git
synced 2023-08-02 15:02:12 +02:00
maint(main): no longer fail on missing env variable
This commit is contained in:
parent
f05ca8407c
commit
75c8d9a1a9
@ -162,11 +162,11 @@ void limit_parallel_dll_loading()
|
|||||||
|
|
||||||
void apply_environment()
|
void apply_environment()
|
||||||
{
|
{
|
||||||
wchar_t* buffer{};
|
char* buffer{};
|
||||||
std::size_t size{};
|
std::size_t size{};
|
||||||
if (_wdupenv_s(&buffer, &size, L"XLABS_AW_INSTALL") != 0 || buffer == nullptr)
|
if (_dupenv_s(&buffer, &size, "XLABS_AW_INSTALL") != 0 || buffer == nullptr)
|
||||||
{
|
{
|
||||||
throw std::runtime_error("Please use the X Labs launcher to run the game!");
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto _ = gsl::finally([&]
|
const auto _ = gsl::finally([&]
|
||||||
@ -174,8 +174,8 @@ void apply_environment()
|
|||||||
std::free(buffer);
|
std::free(buffer);
|
||||||
});
|
});
|
||||||
|
|
||||||
SetCurrentDirectoryW(buffer);
|
SetCurrentDirectoryA(buffer);
|
||||||
SetDllDirectoryW(buffer);
|
SetDllDirectoryA(buffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
|
Loading…
Reference in New Issue
Block a user