diff options
Diffstat (limited to 'NorthstarDedicatedTest/rpakfilesystem.cpp')
-rw-r--r-- | NorthstarDedicatedTest/rpakfilesystem.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/NorthstarDedicatedTest/rpakfilesystem.cpp b/NorthstarDedicatedTest/rpakfilesystem.cpp index b3105996..1a4736a9 100644 --- a/NorthstarDedicatedTest/rpakfilesystem.cpp +++ b/NorthstarDedicatedTest/rpakfilesystem.cpp @@ -108,6 +108,23 @@ void LoadPreloadPaks() } } +void LoadPostloadPaks(char** map) +{ + // note, loading from ./ is necessary otherwise paks will load from gamedir/r2/paks + for (Mod& mod : g_ModManager->m_loadedMods) + { + if (!mod.Enabled) + continue; + + // need to get a relative path of mod to mod folder + fs::path modPakPath("./" / mod.ModDirectory / "paks"); + + for (ModRpakEntry& pak : mod.Rpaks) + if (pak.m_sLoadAfterPak == *map) + g_PakLoadManager->LoadPakAsync((modPakPath / pak.m_sPakName).string().c_str(), false); + } +} + void LoadCustomMapPaks(char** pakName, bool* bNeedToFreePakName) { // whether the vanilla game has this rpak @@ -212,6 +229,8 @@ int LoadPakAsyncHook(char* path, void* unknownSingleton, int flags, void* callba // add the hash to the map g_PakLoadManager->AddLoadedPak(ret, hash); + LoadPostloadPaks(&path); + if (bNeedToFreePakName) delete[] path; |