From 6f9791725c1c8a0d39dee197e6676950f68fc41f Mon Sep 17 00:00:00 2001 From: Carnagion Date: Wed, 17 Aug 2022 07:53:18 +0200 Subject: [PATCH] Add mod to loaded mods before executing patches or assemblies --- Modding/ModLoader.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Modding/ModLoader.cs b/Modding/ModLoader.cs index 6bac94d..9396a5d 100644 --- a/Modding/ModLoader.cs +++ b/Modding/ModLoader.cs @@ -40,6 +40,7 @@ public static Mod LoadMod(string modDirectoryPath, bool executeAssemblies = true { // Load mod Mod mod = new(Mod.Metadata.Load(modDirectoryPath)); + ModLoader.loadedMods.Add(mod.Meta.Id, mod); // Cache XML data of loaded mods for repeat enumeration later XmlElement[] data = ModLoader.LoadedMods.Values @@ -57,9 +58,6 @@ public static Mod LoadMod(string modDirectoryPath, bool executeAssemblies = true ModLoader.StartupMod(mod); } - // Register mod as fully loaded - ModLoader.loadedMods.Add(mod.Meta.Id, mod); - return mod; }