Skip to content

Commit

Permalink
Merge #3051 Don't try to install multiple versions of the same mod
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed May 15, 2020
2 parents a95c9f5 + 9612d3b commit bf3324f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ All notable changes to this project will be documented in this file.
- [Multiple] Show DLC in recommendations list (#3038 by: HebaruSan; reviewed: DasSkelett)
- [Multiple] Prompt user to overwrite manually installed files (#3043 by: HebaruSan; reviewed: DasSkelett)
- [GUI] Master search bar and misc GUI clean-up (#3041 by: HebaruSan; reviewed: DasSkelett)
- [Core] Don't try to install multiple versions of the same mod (#3051 by: HebaruSan; reviewed: DasSkelett)

### Bugfixes

Expand Down
10 changes: 7 additions & 3 deletions Core/Relationships/RelationshipResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -410,15 +410,19 @@ private void ResolveStanza(IEnumerable<RelationshipDescriptor> stanza, Selection
var descriptor1 = descriptor;
List<CkanModule> candidates = descriptor
.LatestAvailableWithProvides(registry, kspversion, modlist.Values)
.Where(mod => descriptor1.WithinBounds(mod) && MightBeInstallable(mod))
.Where(mod => !modlist.ContainsKey(mod.identifier)
&& descriptor1.WithinBounds(mod)
&& MightBeInstallable(mod))
.ToList();
if (candidates.Count == 0)
{
// Nothing found, try again without mod list
// (conflicts will still be caught below)
candidates = descriptor
.LatestAvailableWithProvides(registry, kspversion)
.Where(mod => descriptor1.WithinBounds(mod) && MightBeInstallable(mod))
.Where(mod => !modlist.ContainsKey(mod.identifier)
&& descriptor1.WithinBounds(mod)
&& MightBeInstallable(mod))
.ToList();
}

Expand Down Expand Up @@ -519,7 +523,7 @@ private void Add(CkanModule module, SelectionReason reason)
{
// We should never be adding something twice!
log.ErrorFormat("Assertion failed: Adding {0} twice in relationship resolution", module.identifier);
throw new ArgumentException("Already contains module:" + module.identifier);
throw new ArgumentException("Already contains module: " + module.identifier);
}
modlist.Add(module.identifier, module);
if (!reasons.ContainsKey(module))
Expand Down

0 comments on commit bf3324f

Please sign in to comment.