Skip to content
This repository has been archived by the owner on Nov 28, 2018. It is now read-only.

Commit

Permalink
Fixed assets not installing if the client has not yet been openend on…
Browse files Browse the repository at this point in the history
… OSX, fixed mod compiler crashing when in-dev mods are present
  • Loading branch information
ikkentim committed May 12, 2016
1 parent fed5bff commit 12feb65
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/ParkitectNexus.Client.Darwin/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,10 @@ static void Main(string[] args)
if(!app.Initialize(ToolkitType.Cocoa))
return;

TmpFixModLoaderUtil.InstallModLoader(ObjectFactory.GetInstance<IParkitect>(), ObjectFactory.GetInstance<ILogger>());
MacEngine.App.OpenUrl += (sender, e) =>
{
ObjectFactory.GetInstance<ILogger>().WriteLine($"Got url {e.Url}");

if(e.Url.StartsWith("parkitectnexus://"))
e.Url = e.Url;
else
Expand All @@ -91,6 +92,8 @@ static void Main(string[] args)
app.HandleUrl(url);
};

TmpFixModLoaderUtil.InstallModLoader(ObjectFactory.GetInstance<IParkitect>(), ObjectFactory.GetInstance<ILogger>());

app.Run();
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/ParkitectNexus.Data/Assets/Modding/ModCompiler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,12 @@ public async Task<ModCompileResults> Compile(IModAsset mod)
{
return await Task.Run(() =>
{
var dependencies = mod.Information.Dependencies?.Select(repository =>
var dependencies = mod.Information.Dependencies?.Where(repository => repository != null)
.Select(repository =>
{
var dep =
_parkitect.Assets[AssetType.Mod].OfType<IModAsset>()
.FirstOrDefault(m => m.Repository.ToLower() == repository.ToLower());
.FirstOrDefault(m => m.Repository?.ToLower() == repository.ToLower());

if (dep == null)
throw new Exception($"Dependency {repository} was not installed.");
Expand Down

0 comments on commit 12feb65

Please sign in to comment.