mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-26 04:31:22 +00:00
don't abort when parsing the Steam config fails.
This commit is contained in:
parent
6f2bc8379a
commit
3a5838c8f5
1 changed files with 20 additions and 12 deletions
|
@ -61,6 +61,7 @@
|
|||
|
||||
#include "printf.h"
|
||||
|
||||
#include "engineerrors.h"
|
||||
#include "version.h"
|
||||
#include "i_sound.h"
|
||||
#include "stats.h"
|
||||
|
@ -307,22 +308,29 @@ TArray<FString> I_GetSteamPath()
|
|||
return result;
|
||||
}
|
||||
|
||||
TArray<FString> paths = ParseSteamRegistry((steamPath + "/config/libraryfolders.vdf").GetChars());
|
||||
|
||||
for(FString &path : paths)
|
||||
try
|
||||
{
|
||||
path.ReplaceChars('\\','/');
|
||||
path+="/";
|
||||
}
|
||||
TArray<FString> paths = ParseSteamRegistry((steamPath + "/config/libraryfolders.vdf").GetChars());
|
||||
|
||||
paths.Push(steamPath + "/steamapps/common/");
|
||||
|
||||
for(unsigned int i = 0; i < countof(steam_dirs); ++i)
|
||||
{
|
||||
for(const FString &path : paths)
|
||||
for (FString& path : paths)
|
||||
{
|
||||
result.Push(path + steam_dirs[i]);
|
||||
path.ReplaceChars('\\', '/');
|
||||
path += "/";
|
||||
}
|
||||
|
||||
paths.Push(steamPath + "/steamapps/common/");
|
||||
|
||||
for (unsigned int i = 0; i < countof(steam_dirs); ++i)
|
||||
{
|
||||
for (const FString& path : paths)
|
||||
{
|
||||
result.Push(path + steam_dirs[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (const CRecoverableError& err)
|
||||
{
|
||||
// don't abort on errors in here. Just return an empty path.
|
||||
}
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in a new issue