From ece05901c26a76b6ccb85c4db68071841b13096a Mon Sep 17 00:00:00 2001 From: erri120 Date: Tue, 5 Nov 2019 13:48:03 +0100 Subject: [PATCH] Fixed stack compilation endless loop --- .../CompilationSteps/DeconstructBSAs.cs | 16 ++++++++-------- .../CompilationSteps/IgnoreDisabledMods.cs | 6 +++--- .../IncludeStubbedConfigfiles.cs | 6 +++--- .../CompilationSteps/IncludeTaggedMods.cs | 2 +- .../CompilationSteps/IncludeThisProfile.cs | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Wabbajack.Lib/CompilationSteps/DeconstructBSAs.cs b/Wabbajack.Lib/CompilationSteps/DeconstructBSAs.cs index 142fd413..440b8813 100644 --- a/Wabbajack.Lib/CompilationSteps/DeconstructBSAs.cs +++ b/Wabbajack.Lib/CompilationSteps/DeconstructBSAs.cs @@ -16,7 +16,7 @@ namespace Wabbajack.Lib.CompilationSteps public DeconstructBSAs(ACompiler compiler) : base(compiler) { - _include_directly = compiler._mo2Compiler.ModInis.Where(kv => + _include_directly = _compiler._mo2Compiler.ModInis.Where(kv => { var general = kv.Value.General; if (general.notes != null && general.notes.Contains(Consts.WABBAJACK_INCLUDE)) return true; @@ -28,16 +28,16 @@ namespace Wabbajack.Lib.CompilationSteps _microstack = new List { - new DirectMatch(compiler), - new IncludePatches(compiler._mo2Compiler), - new DropAll(compiler) + new DirectMatch(_compiler._mo2Compiler), + new IncludePatches(_compiler._mo2Compiler), + new DropAll(_compiler._mo2Compiler) }; _microstackWithInclude = new List { - new DirectMatch(compiler), - new IncludePatches(compiler._mo2Compiler), - new IncludeAll(compiler._mo2Compiler) + new DirectMatch(_compiler._mo2Compiler), + new IncludePatches(_compiler._mo2Compiler), + new IncludeAll(_compiler._mo2Compiler) }; } @@ -61,7 +61,7 @@ namespace Wabbajack.Lib.CompilationSteps var id = Guid.NewGuid().ToString(); - var matches = source_files.PMap(e => _compiler.RunStack(stack, new RawSourceFile(e) + var matches = source_files.PMap(e => _compiler._mo2Compiler.RunStack(stack, new RawSourceFile(e) { Path = Path.Combine(Consts.BSACreationDir, id, e.Paths.Last()) })); diff --git a/Wabbajack.Lib/CompilationSteps/IgnoreDisabledMods.cs b/Wabbajack.Lib/CompilationSteps/IgnoreDisabledMods.cs index c7513665..cde06c36 100644 --- a/Wabbajack.Lib/CompilationSteps/IgnoreDisabledMods.cs +++ b/Wabbajack.Lib/CompilationSteps/IgnoreDisabledMods.cs @@ -12,10 +12,10 @@ namespace Wabbajack.Lib.CompilationSteps public IgnoreDisabledMods(ACompiler compiler) : base(compiler) { - var alwaysEnabled = compiler._mo2Compiler.ModInis.Where(f => IsAlwaysEnabled(f.Value)).Select(f => f.Key).ToHashSet(); + var alwaysEnabled = _compiler._mo2Compiler.ModInis.Where(f => IsAlwaysEnabled(f.Value)).Select(f => f.Key).ToHashSet(); - _allEnabledMods = compiler._mo2Compiler.SelectedProfiles - .SelectMany(p => File.ReadAllLines(Path.Combine(compiler._mo2Compiler.MO2Folder, "profiles", p, "modlist.txt"))) + _allEnabledMods = _compiler._mo2Compiler.SelectedProfiles + .SelectMany(p => File.ReadAllLines(Path.Combine(_compiler._mo2Compiler.MO2Folder, "profiles", p, "modlist.txt"))) .Where(line => line.StartsWith("+") || line.EndsWith("_separator")) .Select(line => line.Substring(1)) .Concat(alwaysEnabled) diff --git a/Wabbajack.Lib/CompilationSteps/IncludeStubbedConfigfiles.cs b/Wabbajack.Lib/CompilationSteps/IncludeStubbedConfigfiles.cs index b75c5b95..19019e18 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeStubbedConfigfiles.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeStubbedConfigfiles.cs @@ -26,9 +26,9 @@ namespace Wabbajack.Lib.CompilationSteps var data = File.ReadAllText(source.AbsolutePath); var originalData = data; - data = data.Replace(_compiler.GamePath, Consts.GAME_PATH_MAGIC_BACK); - data = data.Replace(_compiler.GamePath.Replace("\\", "\\\\"), Consts.GAME_PATH_MAGIC_DOUBLE_BACK); - data = data.Replace(_compiler.GamePath.Replace("\\", "/"), Consts.GAME_PATH_MAGIC_FORWARD); + data = data.Replace(_compiler._mo2Compiler.GamePath, Consts.GAME_PATH_MAGIC_BACK); + data = data.Replace(_compiler._mo2Compiler.GamePath.Replace("\\", "\\\\"), Consts.GAME_PATH_MAGIC_DOUBLE_BACK); + data = data.Replace(_compiler._mo2Compiler.GamePath.Replace("\\", "/"), Consts.GAME_PATH_MAGIC_FORWARD); data = data.Replace(_compiler._mo2Compiler.MO2Folder, Consts.MO2_PATH_MAGIC_BACK); data = data.Replace(_compiler._mo2Compiler.MO2Folder.Replace("\\", "\\\\"), Consts.MO2_PATH_MAGIC_DOUBLE_BACK); diff --git a/Wabbajack.Lib/CompilationSteps/IncludeTaggedMods.cs b/Wabbajack.Lib/CompilationSteps/IncludeTaggedMods.cs index f6304f56..dbbf3242 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeTaggedMods.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeTaggedMods.cs @@ -14,7 +14,7 @@ namespace Wabbajack.Lib.CompilationSteps public IncludeTaggedMods(ACompiler compiler, string tag) : base(compiler) { _tag = tag; - _includeDirectly = compiler._mo2Compiler.ModInis.Where(kv => + _includeDirectly = _compiler._mo2Compiler.ModInis.Where(kv => { var general = kv.Value.General; if (general.notes != null && general.notes.Contains(_tag)) diff --git a/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs b/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs index f5ca2515..580f64a8 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs @@ -12,7 +12,7 @@ namespace Wabbajack.Lib.CompilationSteps public IncludeThisProfile(ACompiler compiler) : base(compiler) { - _correctProfiles = compiler._mo2Compiler.SelectedProfiles.Select(p => Path.Combine("profiles", p) + "\\").ToList(); + _correctProfiles = _compiler._mo2Compiler.SelectedProfiles.Select(p => Path.Combine("profiles", p) + "\\").ToList(); } public override Directive Run(RawSourceFile source)