diff --git a/Wabbajack.Common/StoreHandlers/GOGHandler.cs b/Wabbajack.Common/StoreHandlers/GOGHandler.cs index 2bebd135..40686969 100644 --- a/Wabbajack.Common/StoreHandlers/GOGHandler.cs +++ b/Wabbajack.Common/StoreHandlers/GOGHandler.cs @@ -105,15 +105,18 @@ namespace Wabbajack.Common.StoreHandlers }; var gameMeta = GameRegistry.Games.Values.FirstOrDefault(g => - g.GOGIDs != null - && - g.GOGIDs.Contains(game.ID) - && - g.RequiredFiles.TrueForAll(file => - File.Exists(Path.Combine(game.Path, file)))); + { + return g.GOGIDs != null + && (g.SteamIDs?.Contains(gameID) ?? false) + && (g.RequiredFiles?.TrueForAll(file => File.Exists(Path.Combine(game.Path, file))) ?? + true); + }); if (gameMeta == null) + { + Utils.Log($"GOG Game \"{gameName}\"({gameID}) is not supported, skipping"); return; + } game.Game = gameMeta.Game; diff --git a/Wabbajack.Common/StoreHandlers/SteamHandler.cs b/Wabbajack.Common/StoreHandlers/SteamHandler.cs index 13c5cbc5..ed769015 100644 --- a/Wabbajack.Common/StoreHandlers/SteamHandler.cs +++ b/Wabbajack.Common/StoreHandlers/SteamHandler.cs @@ -128,6 +128,8 @@ namespace Wabbajack.Common.StoreHandlers SteamUniverses.Do(u => { + Utils.Log($"Searching for Steam Games in {u}"); + Directory.EnumerateFiles(u, "*.acf", SearchOption.TopDirectoryOnly).Where(File.Exists).Do(f => { var game = new SteamGame(); @@ -146,14 +148,12 @@ namespace Wabbajack.Common.StoreHandlers if (l.Contains("\"name\"")) game.Name = GetVdfValue(l); - if (l.Contains("\"installdir\"")) - { - var path = Path.Combine(u, "common", GetVdfValue(l)); - if (Directory.Exists(path)) - { - game.Path = path; - } - } + if (!l.Contains("\"installdir\"")) + return; + + var path = Path.Combine(u, "common", GetVdfValue(l)); + if (Directory.Exists(path)) + game.Path = path; }); if (!gotID || !Directory.Exists(game.Path)) return; @@ -165,7 +165,10 @@ namespace Wabbajack.Common.StoreHandlers }); if (gameMeta == null) + { + Utils.Log($"Steam Game {game.Name}({game.ID}) is not supported, skipping"); return; + } game.Game = gameMeta.Game; game.Universe = u; @@ -183,7 +186,7 @@ namespace Wabbajack.Common.StoreHandlers return true; } - private void LoadWorkshopItems(SteamGame game) + private static void LoadWorkshopItems(SteamGame game) { if(game.WorkshopItems == null) game.WorkshopItems = new List();