summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2017-06-02 18:25:34 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2017-06-02 18:25:34 -0400
commit559203922bcad4071f8be53b1a61b0026da14396 (patch)
tree2ed664798183d77779beb68b61bd7622140413df /src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs
parent933e889c24e565d9028d3719ba2d65d512890564 (diff)
parent3a8e77a3098572fa413a27f41f832563daec3453 (diff)
downloadSMAPI-559203922bcad4071f8be53b1a61b0026da14396.tar.gz
SMAPI-559203922bcad4071f8be53b1a61b0026da14396.tar.bz2
SMAPI-559203922bcad4071f8be53b1a61b0026da14396.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs')
-rw-r--r--src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs b/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs
index 2c68a639..f5139ce5 100644
--- a/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs
+++ b/src/StardewModdingAPI/Framework/ModLoading/ModResolver.cs
@@ -126,7 +126,6 @@ namespace StardewModdingAPI.Framework.ModLoading
}
}
-#if EXPERIMENTAL
/// <summary>Sort the given mods by the order they should be loaded.</summary>
/// <param name="mods">The mods to process.</param>
public IEnumerable<IModMetadata> ProcessDependencies(IEnumerable<IModMetadata> mods)
@@ -142,20 +141,18 @@ namespace StardewModdingAPI.Framework.ModLoading
states[mod] = ModDependencyStatus.Failed;
sortedMods.Push(mod);
}
-
+
// sort mods
foreach (IModMetadata mod in mods)
this.ProcessDependencies(mods.ToArray(), mod, states, sortedMods, new List<IModMetadata>());
return sortedMods.Reverse();
}
-#endif
/*********
** Private methods
*********/
-#if EXPERIMENTAL
/// <summary>Sort a mod's dependencies by the order they should be loaded, and remove any mods that can't be loaded due to missing or conflicting dependencies.</summary>
/// <param name="mods">The full list of mods being validated.</param>
/// <param name="mod">The mod whose dependencies to process.</param>
@@ -201,7 +198,7 @@ namespace StardewModdingAPI.Framework.ModLoading
string[] missingModIDs =
(
from dependency in mod.Manifest.Dependencies
- where mods.All(m => m.Manifest.UniqueID != dependency.UniqueID)
+ where mods.All(m => m.Manifest?.UniqueID != dependency.UniqueID)
orderby dependency.UniqueID
select dependency.UniqueID
)
@@ -222,7 +219,7 @@ namespace StardewModdingAPI.Framework.ModLoading
IModMetadata[] modsToLoadFirst =
(
from other in mods
- where mod.Manifest.Dependencies.Any(required => required.UniqueID == other.Manifest.UniqueID)
+ where mod.Manifest.Dependencies.Any(required => required.UniqueID == other.Manifest?.UniqueID)
select other
)
.ToArray();
@@ -270,7 +267,6 @@ namespace StardewModdingAPI.Framework.ModLoading
return states[mod] = ModDependencyStatus.Sorted;
}
}
-#endif
/// <summary>Get all mod folders in a root folder, passing through empty folders as needed.</summary>
/// <param name="rootPath">The root folder path to search.</param>