Skip to content

Commit

Permalink
Check game version compatibility when installing specific version
Browse files Browse the repository at this point in the history
  • Loading branch information
HebaruSan committed Dec 18, 2017
1 parent f9dbc08 commit eac3885
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Cmdline/Action/Install.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@ public int RunCommand(CKAN.KSP ksp, object raw_options)
}
catch (ModuleNotFoundKraken ex)
{
user.RaiseMessage("Module {0} required but it is not listed in the index, or not available for your version of KSP.", ex.module);
if (ex.version == null)
{
user.RaiseMessage("Module {0} required but it is not listed in the index, or not available for your version of KSP.", ex.module);
}
else
{
user.RaiseMessage("Module {0} {1} required but it is not listed in the index, or not available for your version of KSP.", ex.module, ex.version);
}
user.RaiseMessage("If you're lucky, you can do a `ckan update` and try again.");
user.RaiseMessage("Try `ckan install --no-recommends` to skip installation of recommended modules.");
return Exit.ERROR;
Expand Down
3 changes: 2 additions & 1 deletion Core/Types/CkanModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ public static CkanModule FromIDandVersion(IRegistryQuerier registry, string mod,

module = registry.GetModuleByVersion(ident, version);

if (module == null)
if (module == null
|| (ksp_version != null && !module.IsCompatibleKSP(ksp_version)))
throw new ModuleNotFoundKraken(ident, version,
string.Format("Module {0} version {1} not available", ident, version));
}
Expand Down

0 comments on commit eac3885

Please sign in to comment.