From e24d29e93df9359ce47c580c436ca62f59e3073c Mon Sep 17 00:00:00 2001
From: Timothy Baldridge <tbaldridge@gmail.com>
Date: Tue, 20 Aug 2019 16:03:18 -0600
Subject: [PATCH] Boom! Basic Fixes.exe compiles with the new VFS compiler

---
 VirtualFileSystem/VirtualFileSystem.cs | 6 ++++--
 Wabbajack/Compiler.cs                  | 2 +-
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/VirtualFileSystem/VirtualFileSystem.cs b/VirtualFileSystem/VirtualFileSystem.cs
index f54f9931..8a3532a4 100644
--- a/VirtualFileSystem/VirtualFileSystem.cs
+++ b/VirtualFileSystem/VirtualFileSystem.cs
@@ -274,7 +274,9 @@ namespace VFS
 
         public StagingGroup StageWith(IEnumerable<VirtualFile> files)
         {
-            return new StagingGroup(files);
+            var grp = new StagingGroup(files);
+            grp.Stage();
+            return grp;
         }
 
         public VirtualFile this[string path]
@@ -330,7 +332,7 @@ namespace VFS
         public VirtualFile FileForArchiveHashPath(string[] archiveHashPath)
         {
             var archive = HashIndex[archiveHashPath[0]].Where(a => a.IsArchive).OrderByDescending(a => a.LastModified).First();
-            string fullPath = HashIndex[archiveHashPath[0]] + "|" + String.Join("|", archiveHashPath.Skip(1));
+            string fullPath = archive.FullPath + "|" + String.Join("|", archiveHashPath.Skip(1));
             return Lookup(fullPath);
         }
     }
diff --git a/Wabbajack/Compiler.cs b/Wabbajack/Compiler.cs
index 2851d74a..64ecc962 100644
--- a/Wabbajack/Compiler.cs
+++ b/Wabbajack/Compiler.cs
@@ -720,7 +720,7 @@ namespace Wabbajack
         {
             var indexed = IndexedFiles.Values
                                       .SelectMany(f => f)
-                                      .GroupBy(f => Path.GetFileName(f.Paths.Last()))
+                                      .GroupBy(f => Path.GetFileName(f.Paths.Last()).ToLower())
                                       .ToDictionary(f => f.Key);
 
             return source =>