From 6857b93f623dffedffac23fdd3983c74621d2b64 Mon Sep 17 00:00:00 2001 From: cat_or_not <41955154+catornot@users.noreply.github.com> Date: Fri, 5 May 2023 12:20:51 -0400 Subject: Support loading plugins from subdirs (#460) Support loading plugins from subdirs to allow for better organising plugins and easier mod-manager installation --- NorthstarDLL/plugins/plugins.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'NorthstarDLL') diff --git a/NorthstarDLL/plugins/plugins.cpp b/NorthstarDLL/plugins/plugins.cpp index 6e3ceb5a..001f3578 100644 --- a/NorthstarDLL/plugins/plugins.cpp +++ b/NorthstarDLL/plugins/plugins.cpp @@ -52,8 +52,8 @@ std::optional PluginManager::LoadPlugin(fs::path path, PluginInitFuncs* Plugin plugin {}; - std::string pathstring = (pluginPath / path).string(); - std::wstring wpath = (pluginPath / path).wstring(); + std::string pathstring = path.string(); + std::wstring wpath = path.wstring(); LPCWSTR wpptr = wpath.c_str(); HMODULE datafile = LoadLibraryExW(wpptr, 0, LOAD_LIBRARY_AS_DATAFILE | LOAD_LIBRARY_AS_IMAGE_RESOURCE); // Load the DLL as a data file @@ -222,7 +222,7 @@ bool PluginManager::LoadPlugins() for (auto const& entry : iterator) { if (fs::is_regular_file(entry) && entry.path().extension() == ".dll") - paths.emplace_back(entry.path().filename()); + paths.emplace_back(entry.path()); } for (fs::path path : paths) { -- cgit v1.2.3