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

Recursive loading of mods from nml_mods #51

Merged
merged 4 commits into from
Aug 2, 2022
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions NeosModLoader/AssemblyLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ internal static class AssemblyLoader
string[]? assembliesToLoad = null;
try
{
assembliesToLoad = Directory.GetFiles(assembliesDirectory, "*.dll");
Array.Sort(assembliesToLoad, (a, b) => string.CompareOrdinal(a, b));
assembliesToLoad = Directory.GetFiles(assembliesDirectory, "*.dll", SearchOption.AllDirectories);
}
catch (Exception e)
{
Expand All @@ -38,6 +37,7 @@ internal static class AssemblyLoader
Logger.ErrorInternal($"Error enumerating ${dirName} directory:\n{e}");
}
}
Array.Sort(assembliesToLoad, (a, b) => string.CompareOrdinal(a, b));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...Though wouldn't this throw if assembliesToLoad is never initialized...?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would. Somehow that got moved down out of the try...catch. I moved it back in now.

return assembliesToLoad;
}

Expand Down
1 change: 1 addition & 0 deletions NeosModLoader/NeosModLoader.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
<NeosPath>$(MSBuildThisFileDirectory)NeosVR/</NeosPath>
<NeosPath Condition="Exists('C:\Program Files (x86)\Steam\steamapps\common\NeosVR\')">C:\Program Files (x86)\Steam\steamapps\common\NeosVR\</NeosPath>
<NeosPath Condition="Exists('$(HOME)/.steam/steam/steamapps/common/NeosVR/')">$(HOME)/.steam/steam/steamapps/common/NeosVR/</NeosPath>
<NeosPath Condition="Exists('D:/Files/Games/Neos/app/')">D:/Files/Games/Neos/app/</NeosPath>
</PropertyGroup>

<ItemGroup>
Expand Down