Fixed stack compilation endless loop

This commit is contained in:
erri120 2019-11-05 13:48:03 +01:00 committed by Timothy Baldridge
parent 6a4600dcc1
commit ece05901c2
5 changed files with 16 additions and 16 deletions

View File

@ -16,7 +16,7 @@ namespace Wabbajack.Lib.CompilationSteps
public DeconstructBSAs(ACompiler compiler) : base(compiler) 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; var general = kv.Value.General;
if (general.notes != null && general.notes.Contains(Consts.WABBAJACK_INCLUDE)) return true; if (general.notes != null && general.notes.Contains(Consts.WABBAJACK_INCLUDE)) return true;
@ -28,16 +28,16 @@ namespace Wabbajack.Lib.CompilationSteps
_microstack = new List<ICompilationStep> _microstack = new List<ICompilationStep>
{ {
new DirectMatch(compiler), new DirectMatch(_compiler._mo2Compiler),
new IncludePatches(compiler._mo2Compiler), new IncludePatches(_compiler._mo2Compiler),
new DropAll(compiler) new DropAll(_compiler._mo2Compiler)
}; };
_microstackWithInclude = new List<ICompilationStep> _microstackWithInclude = new List<ICompilationStep>
{ {
new DirectMatch(compiler), new DirectMatch(_compiler._mo2Compiler),
new IncludePatches(compiler._mo2Compiler), new IncludePatches(_compiler._mo2Compiler),
new IncludeAll(compiler._mo2Compiler) new IncludeAll(_compiler._mo2Compiler)
}; };
} }
@ -61,7 +61,7 @@ namespace Wabbajack.Lib.CompilationSteps
var id = Guid.NewGuid().ToString(); 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()) Path = Path.Combine(Consts.BSACreationDir, id, e.Paths.Last())
})); }));

View File

@ -12,10 +12,10 @@ namespace Wabbajack.Lib.CompilationSteps
public IgnoreDisabledMods(ACompiler compiler) : base(compiler) 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 _allEnabledMods = _compiler._mo2Compiler.SelectedProfiles
.SelectMany(p => File.ReadAllLines(Path.Combine(compiler._mo2Compiler.MO2Folder, "profiles", p, "modlist.txt"))) .SelectMany(p => File.ReadAllLines(Path.Combine(_compiler._mo2Compiler.MO2Folder, "profiles", p, "modlist.txt")))
.Where(line => line.StartsWith("+") || line.EndsWith("_separator")) .Where(line => line.StartsWith("+") || line.EndsWith("_separator"))
.Select(line => line.Substring(1)) .Select(line => line.Substring(1))
.Concat(alwaysEnabled) .Concat(alwaysEnabled)

View File

@ -26,9 +26,9 @@ namespace Wabbajack.Lib.CompilationSteps
var data = File.ReadAllText(source.AbsolutePath); var data = File.ReadAllText(source.AbsolutePath);
var originalData = data; var originalData = data;
data = data.Replace(_compiler.GamePath, Consts.GAME_PATH_MAGIC_BACK); data = data.Replace(_compiler._mo2Compiler.GamePath, Consts.GAME_PATH_MAGIC_BACK);
data = data.Replace(_compiler.GamePath.Replace("\\", "\\\\"), Consts.GAME_PATH_MAGIC_DOUBLE_BACK); data = data.Replace(_compiler._mo2Compiler.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.Replace("\\", "/"), Consts.GAME_PATH_MAGIC_FORWARD);
data = data.Replace(_compiler._mo2Compiler.MO2Folder, Consts.MO2_PATH_MAGIC_BACK); data = data.Replace(_compiler._mo2Compiler.MO2Folder, Consts.MO2_PATH_MAGIC_BACK);
data = data.Replace(_compiler._mo2Compiler.MO2Folder.Replace("\\", "\\\\"), Consts.MO2_PATH_MAGIC_DOUBLE_BACK); data = data.Replace(_compiler._mo2Compiler.MO2Folder.Replace("\\", "\\\\"), Consts.MO2_PATH_MAGIC_DOUBLE_BACK);

View File

@ -14,7 +14,7 @@ namespace Wabbajack.Lib.CompilationSteps
public IncludeTaggedMods(ACompiler compiler, string tag) : base(compiler) public IncludeTaggedMods(ACompiler compiler, string tag) : base(compiler)
{ {
_tag = tag; _tag = tag;
_includeDirectly = compiler._mo2Compiler.ModInis.Where(kv => _includeDirectly = _compiler._mo2Compiler.ModInis.Where(kv =>
{ {
var general = kv.Value.General; var general = kv.Value.General;
if (general.notes != null && general.notes.Contains(_tag)) if (general.notes != null && general.notes.Contains(_tag))

View File

@ -12,7 +12,7 @@ namespace Wabbajack.Lib.CompilationSteps
public IncludeThisProfile(ACompiler compiler) : base(compiler) 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) public override Directive Run(RawSourceFile source)