Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
Fixed TargetInvocationException when deselecting a mod some other mod…
Browse files Browse the repository at this point in the history
… depends on

Fixes KSP-CKAN#1371
  • Loading branch information
Postremus authored and ayan4m1 committed Sep 3, 2016
1 parent e704874 commit 1c658ce
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion GUI/MainModList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,13 @@ public async Task<IEnumerable<ModChange>> 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)
Expand Down Expand Up @@ -439,6 +445,11 @@ public async Task<IEnumerable<ModChange>> 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()));
Expand Down

0 comments on commit 1c658ce

Please sign in to comment.