Skip to content

Commit 8125298

Browse files
committed
Fix disabled mods patches still being applied ... pesky newlines
1 parent 3d1f21d commit 8125298

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/PatchManager.Core/CoreModule.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ public class CoreModule : BaseModule
2727

2828
private bool _wasCacheInvalidated;
2929

30-
private static bool ShouldLoad(string[] disabled, string modInfoLocation)
30+
private static bool ShouldLoad(IEnumerable<string> disabled, string modInfoLocation)
3131
{
3232
if (!File.Exists(modInfoLocation))
3333
return false;
3434
try
3535
{
3636
var metadata = JsonConvert.DeserializeObject<ModInfo>(File.ReadAllText(modInfoLocation));
37-
return metadata.ModID == null || !disabled.Contains(metadata.ModID);
37+
return metadata.ModID == null || disabled.All(x => x != metadata.ModID);
3838
}
3939
catch
4040
{
@@ -90,8 +90,8 @@ public override void PreLoad()
9090
var gameDataModsExists = Directory.Exists(Path.Combine(Paths.GameRootPath, "GameData/Mods"));
9191

9292
// Go here instead so that the static constructor recognizes everything
93-
var disabledPlugins = File.ReadAllText(Path.Combine(Paths.BepInExRootPath, "disabled_plugins.cfg"))
94-
.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries);
93+
var disabledPlugins = File.ReadAllText(SpaceWarp.Preload.API.CommonPaths.DisabledPluginsFilepath)
94+
.Split(new[] { '\n' }, StringSplitOptions.RemoveEmptyEntries).Select(x => x.Trim()).ToList();
9595

9696
var modFolders = Directory.GetDirectories(Paths.PluginPath, "*", SearchOption.AllDirectories)
9797
.Where(dir => ShouldLoad(disabledPlugins, Path.Combine(dir, "swinfo.json")))

src/PatchManager.Core/PatchManager.Core.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<PackageReference Include="BepInEx.AssemblyPublicizer.MSBuild" Version="0.4.1" PrivateAssets="all" />
66
<PackageReference Include="KerbalSpaceProgram2.GameLibs" Version="0.2.0" PrivateAssets="all" Publicize="true" />
77
<PackageReference Include="Premonition.Core" Version="0.1.0" />
8-
<PackageReference Include="SpaceWarp" Version="1.7.0" PrivateAssets="all" Publicize="true" />
8+
<PackageReference Include="SpaceWarp" Version="1.8.1" PrivateAssets="all" Publicize="true" />
99
</ItemGroup>
1010
<ItemGroup Label="Project references">
1111
<ProjectReference Include="$(SolutionDir)/src/PatchManager.SassyPatching/PatchManager.SassyPatching.csproj" Private="false" />

0 commit comments

Comments
 (0)