fix incorrect 'mod already loaded' errors in some cases

This commit is contained in:
Jesse Plamondon-Willard 2017-08-23 16:13:28 -04:00
parent 8ba54a682f
commit e93d58f69b
1 changed files with 1 additions and 1 deletions

View File

@ -76,7 +76,7 @@ namespace StardewModdingAPI.Framework.ModLoading
: $"Could not load '{assemblyPath}'."
);
}
if (assemblies[0].Status == AssemblyLoadStatus.AlreadyLoaded)
if (assemblies.Last().Status == AssemblyLoadStatus.AlreadyLoaded) // mod assembly is last in dependency order
throw new SAssemblyLoadFailedException($"Could not load '{assemblyPath}' because it was already loaded. Do you have two copies of this mod?");
// rewrite & load assemblies in leaf-to-root order