From 84b27b2a9c4fe8d03a4ccebb9083d42d9a43d171 Mon Sep 17 00:00:00 2001 From: Justin Swanson Date: Mon, 11 May 2020 17:14:45 -0500 Subject: [PATCH] Readded a nuked feature Was originally from this commit: 7fba212ba365bf2d8906df8be0178c3952199020 --- .../CompilationSteps/IncludeThisProfile.cs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs b/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs index 4d0141a3..8e3be39b 100644 --- a/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs +++ b/Wabbajack.Lib/CompilationSteps/IncludeThisProfile.cs @@ -39,10 +39,17 @@ namespace Wabbajack.Lib.CompilationSteps return new State(); } - private static async Task ReadAndCleanModlist(AbsolutePath absolutePath) - { - var lines = await absolutePath.ReadAllLinesAsync(); - lines = lines.Where(line => !(line.StartsWith("-") && !line.EndsWith("_separator"))).ToArray(); + private async Task ReadAndCleanModlist(AbsolutePath absolutePath) + { + var alwaysEnabled = _mo2Compiler.ModInis.Where(f => IgnoreDisabledMods.IsAlwaysEnabled(f.Value)) + .Select(f => f.Key) + .Distinct(); + var lines = File.ReadAllLines(absolutePath.ToString()).Where(l => + { + return l.StartsWith("+") + || alwaysEnabled.Any(x => x.Equals(l.Substring(1))) + || l.EndsWith("_separator"); + }).ToArray(); return Encoding.UTF8.GetBytes(string.Join("\r\n", lines)); }