aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/modmanager.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 21:22:43 +0000
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2021-11-05 21:22:43 +0000
commit3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee (patch)
tree5832fe2ee5f8e9334196e9f67cee93fb382ef1a7 /NorthstarDedicatedTest/modmanager.cpp
parentce9cb0134fefaa2bf5a3da0f9de15f013ab7dd27 (diff)
downloadNorthstarLauncher-3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee.tar.gz
NorthstarLauncher-3d4eb42b4aaf89a4f5f3e74cb50f1fa557b272ee.zip
small dedi changes
Diffstat (limited to 'NorthstarDedicatedTest/modmanager.cpp')
-rw-r--r--NorthstarDedicatedTest/modmanager.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/NorthstarDedicatedTest/modmanager.cpp b/NorthstarDedicatedTest/modmanager.cpp
index 956ea90f..cd479408 100644
--- a/NorthstarDedicatedTest/modmanager.cpp
+++ b/NorthstarDedicatedTest/modmanager.cpp
@@ -12,6 +12,7 @@
#include <string>
#include <sstream>
#include <vector>
+#include "filesystem.h"
ModManager* g_ModManager;
@@ -189,8 +190,6 @@ void ModManager::LoadMods()
if (m_hasLoadedMods)
UnloadMods();
- m_hasLoadedMods = true;
-
std::vector<fs::path> modDirs;
// ensure dirs exist
@@ -289,7 +288,11 @@ void ModManager::LoadMods()
std::string formattedPath = file.path().filename().string();
// this really fucking sucks but it'll work
- mod->Vpks.push_back((file.path().parent_path() / formattedPath.substr(strlen("english"), formattedPath.find(".bsp") - 3)).string());
+ std::string vpkName = (file.path().parent_path() / formattedPath.substr(strlen("english"), formattedPath.find(".bsp") - 3)).string();
+ mod->Vpks.push_back(vpkName);
+
+ if (m_hasLoadedMods)
+ (*g_Filesystem)->m_vtable->MountVPK(*g_Filesystem, vpkName.c_str());
}
}
}
@@ -332,6 +335,8 @@ void ModManager::LoadMods()
}
}
}
+
+ m_hasLoadedMods = true;
}
void ModManager::UnloadMods()