From 2a8b4f5bbc63a0b522c0e1e27fed933db5692bd5 Mon Sep 17 00:00:00 2001 From: Timothy Baldridge Date: Sat, 20 Aug 2022 21:08:34 -0600 Subject: [PATCH] 3.0.0.4 --- CHANGELOG.md | 3 +++ Wabbajack.Compiler/ACompiler.cs | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86a97412..4aabf1d6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ ### Changelog +#### Version - 3.0.0.4 - 8/20/2022 +* Fix for: when some optional game files weren't present (like CreationKit.exe), the app would refuse to recognize any files from that game + #### Version - 3.0.0.3 - 8/20/2022 * Properly detect the program version * Fix how the download folder is set in MO2 during installation diff --git a/Wabbajack.Compiler/ACompiler.cs b/Wabbajack.Compiler/ACompiler.cs index 15438895..fdde73df 100644 --- a/Wabbajack.Compiler/ACompiler.cs +++ b/Wabbajack.Compiler/ACompiler.cs @@ -255,15 +255,17 @@ public abstract class ACompiler _logger.LogInformation($"Including {files.Length} stock game files from {ag} as download sources"); GameHashes[ag] = files.Select(f => f.Hash).ToHashSet(); - IndexedArchives.AddRange(files.Select(f => + IndexedArchives.AddRange(files.TryKeep(f => { var state = (GameFileSource) f.State; - return new IndexedArchive( - _vfs.Index.ByRootPath[path.Combine(state.GameFile)]) - { - Name = state.GameFile.ToString().Replace("/", "_").Replace("\\", "_"), - State = state - }; + if (_vfs.Index.ByRootPath.TryGetValue(path.Combine(state.GameFile), out var vf)) { + return (true, new IndexedArchive(vf) + { + Name = state.GameFile.ToString().Replace("/", "_").Replace("\\", "_"), + State = state + }); + } + return default; })); } catch (Exception e)