If game folder files exist, ignore the game folder

This commit is contained in:
Timothy Baldridge 2020-01-06 22:23:59 -07:00
parent e38d67fee1
commit 324ddae397

View File

@ -1,5 +1,6 @@
using Compression.BSA; using Compression.BSA;
using System; using System;
using System.Collections;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
@ -159,9 +160,19 @@ namespace Wabbajack.Lib
.Where(p => p.FileExists()) .Where(p => p.FileExists())
.Select(p => new RawSourceFile(VFS.Index.ByRootPath[p], p.RelativeTo(MO2Folder))); .Select(p => new RawSourceFile(VFS.Index.ByRootPath[p], p.RelativeTo(MO2Folder)));
var gameFiles = Directory.EnumerateFiles(GamePath, "*", SearchOption.AllDirectories) // If Game Folder Files exists, ignore the game folder
IEnumerable<RawSourceFile> gameFiles;
if (!Directory.Exists(Path.Combine(MO2Folder, Consts.GameFolderFilesDir)))
{
gameFiles = Directory.EnumerateFiles(GamePath, "*", SearchOption.AllDirectories)
.Where(p => p.FileExists()) .Where(p => p.FileExists())
.Select(p => new RawSourceFile(VFS.Index.ByRootPath[p], Path.Combine(Consts.GameFolderFilesDir, p.RelativeTo(GamePath)))); .Select(p => new RawSourceFile(VFS.Index.ByRootPath[p],
Path.Combine(Consts.GameFolderFilesDir, p.RelativeTo(GamePath))));
}
else
{
gameFiles = new List<RawSourceFile>();
}
ModMetas = Directory.EnumerateDirectories(Path.Combine(MO2Folder, "mods")) ModMetas = Directory.EnumerateDirectories(Path.Combine(MO2Folder, "mods"))