aboutsummaryrefslogtreecommitdiff
path: root/primedev/mods/modmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'primedev/mods/modmanager.cpp')
-rw-r--r--primedev/mods/modmanager.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/primedev/mods/modmanager.cpp b/primedev/mods/modmanager.cpp
index f0ddb0f5..b99c8761 100644
--- a/primedev/mods/modmanager.cpp
+++ b/primedev/mods/modmanager.cpp
@@ -644,9 +644,20 @@ void ModManager::LoadMods()
std::filesystem::directory_iterator remoteModsDir = fs::directory_iterator(GetRemoteModFolderPath());
std::filesystem::directory_iterator thunderstoreModsDir = fs::directory_iterator(GetThunderstoreLegacyModFolderPath());
+ // Set up regex for `Northstar.*` pattern
+ std::regex northstar_pattern(R"(.*\\Northstar\..+)");
for (fs::directory_entry dir : coreModsDir)
+ {
+ if (!std::regex_match(dir.path().string(), northstar_pattern))
+ {
+ spdlog::warn(
+ "The following directory did not match 'Northstar.*' and is most likely an incorrectly manually installed mod: {}",
+ dir.path().string());
+ continue; // skip loading mod that doesn't match
+ }
if (fs::exists(dir.path() / "mod.json"))
modDirs.push_back(dir.path());
+ }
for (fs::directory_entry dir : manualModsDir)
if (fs::exists(dir.path() / "mod.json"))