Exclude requested mods that are also in the world
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System.Collections.Immutable;
|
using System.Collections.Immutable;
|
||||||
using System.Reflection.Emit;
|
using System.Reflection.Emit;
|
||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
|
using Plugin.ClientModLoader.Utils;
|
||||||
using Sandbox.Definitions;
|
using Sandbox.Definitions;
|
||||||
using Sandbox.Engine.Networking;
|
using Sandbox.Engine.Networking;
|
||||||
using Sandbox.Game.World;
|
using Sandbox.Game.World;
|
||||||
@@ -31,7 +32,7 @@ internal static class ModInjector
|
|||||||
var resolvedMods = mods.ToImmutableDictionary(b => b.PublishedFileId);
|
var resolvedMods = mods.ToImmutableDictionary(b => b.PublishedFileId);
|
||||||
|
|
||||||
// list of selected mods which are resolved
|
// list of selected mods which are resolved
|
||||||
var requestedMods = mods.IntersectBy(Mods, b => b.PublishedFileId)
|
var requestedMods = mods.IntersectBy(Mods, b => b.PublishedFileId).ExceptBy(worldMods, b => b.PublishedFileId)
|
||||||
.ToDictionary(b => b.PublishedFileId);
|
.ToDictionary(b => b.PublishedFileId);
|
||||||
|
|
||||||
// add dependencies of requested mods
|
// add dependencies of requested mods
|
||||||
|
Reference in New Issue
Block a user