aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/modmanager.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-07-27 04:27:26 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-07-27 04:27:26 +0100
commit64b8db08ed9bd9de5aae85aedbf07caf51cb819c (patch)
treeab9de693f02d318d942b595aebe206a550f1db2c /NorthstarDedicatedTest/modmanager.cpp
parent80428e6f62899162c036f2752edfbfd7d1adb80b (diff)
downloadNorthstarLauncher-64b8db08ed9bd9de5aae85aedbf07caf51cb819c.tar.gz
NorthstarLauncher-64b8db08ed9bd9de5aae85aedbf07caf51cb819c.zip
add pdata support, improve filesystem hooks
Diffstat (limited to 'NorthstarDedicatedTest/modmanager.cpp')
-rw-r--r--NorthstarDedicatedTest/modmanager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/NorthstarDedicatedTest/modmanager.cpp b/NorthstarDedicatedTest/modmanager.cpp
index 66fff17f..ea16f591 100644
--- a/NorthstarDedicatedTest/modmanager.cpp
+++ b/NorthstarDedicatedTest/modmanager.cpp
@@ -162,12 +162,6 @@ Mod::Mod(fs::path modDir, char* jsonBuf)
}
}
- // vpk stuff
- if (fs::exists(modDir / "vpk"))
- for (fs::directory_entry file : fs::directory_iterator(modDir / "vpk"))
- if (fs::is_regular_file(file) && file.path().extension() == "vpk")
- Vpks.push_back(file.path().string());
-
wasReadSuccessfully = true;
}
@@ -239,6 +233,12 @@ void ModManager::LoadMods()
for (ModConVar* convar : mod->ConVars)
if (g_CustomConvars.find(convar->Name) == g_CustomConvars.end()) // make sure convar isn't registered yet, unsure if necessary but idk what behaviour is for defining same convar multiple times
RegisterConVar(convar->Name.c_str(), convar->DefaultValue.c_str(), convar->Flags, convar->HelpString.c_str());
+
+ // read vpk paths
+ if (fs::exists(mod->ModDirectory / "vpk"))
+ for (fs::directory_entry file : fs::directory_iterator(mod->ModDirectory / "vpk"))
+ if (fs::is_regular_file(file) && file.path().extension() == "vpk")
+ mod->Vpks.push_back(file.path().string());
}
// in a seperate loop because we register mod files in reverse order, since mods loaded later should have their files prioritised