Skip to content

Commit

Permalink
Avoid AssembliesOverride if not found.
Browse files Browse the repository at this point in the history
  • Loading branch information
CptMoore committed Jan 23, 2023
1 parent f45a6ca commit ee043d6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ModTekPreloader/Injector/AssemblyCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@ internal AssemblyCache()
{
searchDirectories = new List<string>
{
Paths.AssembliesOverrideDirectory,
Paths.ModTekDirectory,
Paths.ManagedDirectory
};

if (Directory.Exists(Paths.AssembliesOverrideDirectory))
{
searchDirectories.Insert(0, Paths.AssembliesOverrideDirectory);
}
}

public AssemblyDefinition Resolve(AssemblyNameReference name)
Expand Down
5 changes: 5 additions & 0 deletions ModTekPreloader/Loader/Preloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,11 @@ private static void PreloadAssembliesInjected()

private static void PreloadAssembliesOverride()
{
if (!Directory.Exists(Paths.AssembliesOverrideDirectory))
{
return;
}

Logger.Main.Log($"Preloading override assemblies from `{Paths.GetRelativePath(Paths.AssembliesOverrideDirectory)}`:");
foreach (var file in Directory.GetFiles(Paths.AssembliesOverrideDirectory, "*.dll").OrderBy(p => p))
{
Expand Down

0 comments on commit ee043d6

Please sign in to comment.