aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/dllmain.cpp
diff options
context:
space:
mode:
authorEmma Miler <27428383+emma-miler@users.noreply.github.com>2022-03-06 19:39:01 +0100
committerGitHub <noreply@github.com>2022-03-06 18:39:01 +0000
commit218f0d1435c6b07f7cfb16cee0e962b91488c661 (patch)
tree40db340ea2c66af016d4d9c62bd721f6fd8c45b5 /NorthstarDedicatedTest/dllmain.cpp
parent13dcc7d9307b160131ed80832efda99001aa6c6d (diff)
downloadNorthstarLauncher-218f0d1435c6b07f7cfb16cee0e962b91488c661.tar.gz
NorthstarLauncher-218f0d1435c6b07f7cfb16cee0e962b91488c661.zip
Fixed crash with plugin loading (#102)
Diffstat (limited to 'NorthstarDedicatedTest/dllmain.cpp')
-rw-r--r--NorthstarDedicatedTest/dllmain.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/NorthstarDedicatedTest/dllmain.cpp b/NorthstarDedicatedTest/dllmain.cpp
index d6bc5091..f906e724 100644
--- a/NorthstarDedicatedTest/dllmain.cpp
+++ b/NorthstarDedicatedTest/dllmain.cpp
@@ -91,7 +91,11 @@ bool LoadPlugins()
std::vector<fs::path> paths;
std::string pluginPath = GetNorthstarPrefix() + "/plugins";
-
+ if (!fs::exists(pluginPath))
+ {
+ spdlog::warn("Could not find a plugins directory. Skipped loading plugins");
+ return false;
+ }
// ensure dirs exist
fs::recursive_directory_iterator iterator(pluginPath);
if (std::filesystem::begin(iterator) == std::filesystem::end(iterator))
@@ -104,9 +108,7 @@ bool LoadPlugins()
if (fs::is_regular_file(entry) && entry.path().extension() == ".dll")
paths.emplace_back(entry.path().filename());
}
- // system("pause");
initGameState();
- // spdlog::info("Loading the following DLLs in plugins folder:");
for (fs::path path : paths)
{
std::string pathstring = (pluginPath / path).string();