Core/PluginLoader: Allows loading from environment folders

This commit is contained in:
SirLynix 2022-08-27 02:58:34 +02:00
parent 642d043fd8
commit 01f3f350fe
1 changed files with 0 additions and 7 deletions

View File

@ -27,7 +27,6 @@ namespace Nz
if (path.extension() != NAZARA_DYNLIB_EXTENSION) if (path.extension() != NAZARA_DYNLIB_EXTENSION)
path += NAZARA_DYNLIB_EXTENSION; path += NAZARA_DYNLIB_EXTENSION;
bool exists = false;
if (!path.is_absolute()) if (!path.is_absolute())
{ {
for (const std::filesystem::path& dir : m_directories) for (const std::filesystem::path& dir : m_directories)
@ -36,16 +35,10 @@ namespace Nz
if (std::filesystem::exists(testPath)) if (std::filesystem::exists(testPath))
{ {
path = testPath; path = testPath;
exists = true;
break; break;
} }
} }
} }
else if (std::filesystem::exists(path))
exists = true;
if (!exists)
throw std::runtime_error("failed to find plugin file");
DynLib library; DynLib library;
if (!library.Load(path)) if (!library.Load(path))