Added check for InstallDir

This commit is contained in:
erri120 2019-12-14 22:43:47 +01:00
parent e13a57009a
commit 3c21dfd781
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -97,7 +97,8 @@ namespace Wabbajack.Common
});
// Default path in the Steam folder isn't in the configs
paths.Add(Path.Combine(SteamPath, "steamapps"));
if(Directory.Exists(Path.Combine(SteamPath, "steamapps")))
paths.Add(Path.Combine(SteamPath, "steamapps"));
InstallFolders = paths;
}
@ -123,8 +124,11 @@ namespace Wabbajack.Common
return;
if(l.Contains("\"name\""))
steamGame.Name = GetVdfValue(l);
if(l.Contains("\"installdir\""))
steamGame.InstallDir = Path.Combine(p, "common", GetVdfValue(l));
if (l.Contains("\"installdir\""))
{
var path = Path.Combine(p, "common", GetVdfValue(l));
steamGame.InstallDir = Directory.Exists(path) ? path : null;
}
if (steamGame.AppId != 0 && !string.IsNullOrWhiteSpace(steamGame.Name) &&
!string.IsNullOrWhiteSpace(steamGame.InstallDir))