From 4c2c6077e1015b159510385d1e462907f1bf7fd9 Mon Sep 17 00:00:00 2001 From: Postremus Date: Wed, 12 Aug 2015 18:23:09 +0200 Subject: [PATCH] Fixed TargetInvocationException when deselecting a mod some other mod depends on Fixes #1371 --- GUI/MainModList.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/GUI/MainModList.cs b/GUI/MainModList.cs index 21e56e6859..30ea77547a 100644 --- a/GUI/MainModList.cs +++ b/GUI/MainModList.cs @@ -370,7 +370,13 @@ public async Task> ComputeChangeSetFromModList( var options = new RelationshipResolverOptions { without_toomanyprovides_kraken = false, - with_recommends = false + with_recommends = false, + //See #1371 + //The code inside the while loop is only responsible for handling tmp resolution + //Inconsistencies are handled later, + //and this options are also disabled there + procede_with_inconsistencies = true, + without_enforce_consistency = true }; foreach (var change in changeSet) @@ -440,6 +446,11 @@ public async Task> ComputeChangeSetFromModList( changeSet.Add(new ModChange(new GUIMod(module_by_version, registry, version), GUIModChangeType.Remove, null)); } //May throw InconsistentKraken + //We want to allow InconstistencyKraken's + //Because we use them to check if something conflicts + options.procede_with_inconsistencies = false; + options.without_enforce_consistency = false; + var resolver = new RelationshipResolver(options, registry, version); resolver.RemoveModsFromInstalledList( changeSet.Where(change => change.ChangeType.Equals(GUIModChangeType.Remove)).Select(m => m.Mod.ToModule()));