diff --git a/Exiled.Loader/Loader.cs b/Exiled.Loader/Loader.cs index bff77523c9..a3c0b0f3f6 100644 --- a/Exiled.Loader/Loader.cs +++ b/Exiled.Loader/Loader.cs @@ -234,8 +234,9 @@ public static IPlugin CreatePlugin(Assembly assembly) public static void EnablePlugins() { List> toLoad = Plugins.ToList(); + List> toLoad2 = new(); - foreach (IPlugin plugin in toLoad.ToList()) + foreach (IPlugin plugin in toLoad) { try { @@ -243,7 +244,10 @@ public static void EnablePlugins() { plugin.OnEnabled(); plugin.OnRegisteringCommands(); - toLoad.Remove(plugin); + } + else + { + toLoad2.Add(plugin); } if (plugin.Config.Debug) @@ -255,7 +259,7 @@ public static void EnablePlugins() } } - foreach (IPlugin plugin in toLoad) + foreach (IPlugin plugin in toLoad2) { try {