Fixed manual game file detection for files within archive within an archive

This commit is contained in:
erri120 2019-12-15 12:44:20 +01:00
parent d2a80b25c6
commit 6aeb5f80ff
No known key found for this signature in database
GPG Key ID: A8C0A18D8D4D3135

View File

@ -177,7 +177,7 @@ namespace Wabbajack.Lib
continue;
IndexedArchive targetArchive = null;
IndexedArchives.Where(a => a.File.Children.Contains(element)).Do(a => targetArchive = a);
IndexedArchives.Where(a => a.File.ThisAndAllChildren.Contains(element)).Do(a => targetArchive = a);
if (targetArchive == null)
continue;
@ -192,7 +192,7 @@ namespace Wabbajack.Lib
var replace = f;
var name = replace.File.Name;
var archiveName = targetArchive.Name;
var elementPath = element.FullPath.Substring(element.FullPath.IndexOf('|')+1);
var elementPath = element.FullPath.Substring(element.FullPath.LastIndexOf('|')+1);
var gameToFile = name.Substring(GamePath.Length + 1).Replace(elementPath, "");
if (gameToFile.EndsWith("\\"))
gameToFile = gameToFile.Substring(0, gameToFile.Length - 1);
@ -390,7 +390,7 @@ namespace Wabbajack.Lib
ActiveArchives.Add(Path.GetFileNameWithoutExtension(f));
});
if (lines.Any(line => line.Contains("directURL=")))
if (lines.Any(line => line.Contains("directURL=")) && !ActiveArchives.Contains(Path.GetFileNameWithoutExtension(f)))
{
Utils.Log($"File {f} appears to not come from the Nexus, adding to ActiveArchives");
ActiveArchives.Add(Path.GetFileNameWithoutExtension(f));