diff options
author | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-08-22 21:59:18 +0100 |
---|---|---|
committer | BobTheBob9 <for.oliver.kirkham@gmail.com> | 2022-08-22 21:59:18 +0100 |
commit | ee8ae568bc42cb5311edd7294eb0f8f2ae078bd1 (patch) | |
tree | 9cb1cdb308d81772812cd4456f94634ee10b6670 /NorthstarDLL/rpakfilesystem.cpp | |
parent | 921668fd9578d514258edec7432b656cc5d7041d (diff) | |
download | NorthstarLauncher-ee8ae568bc42cb5311edd7294eb0f8f2ae078bd1.tar.gz NorthstarLauncher-ee8ae568bc42cb5311edd7294eb0f8f2ae078bd1.zip |
add more prs
Diffstat (limited to 'NorthstarDLL/rpakfilesystem.cpp')
-rw-r--r-- | NorthstarDLL/rpakfilesystem.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/NorthstarDLL/rpakfilesystem.cpp b/NorthstarDLL/rpakfilesystem.cpp index bc2195ba..6c01a2e0 100644 --- a/NorthstarDLL/rpakfilesystem.cpp +++ b/NorthstarDLL/rpakfilesystem.cpp @@ -112,6 +112,23 @@ void LoadPreloadPaks() } } +void LoadPostloadPaks(const char* pPath) +{ + // note, loading from ./ is necessary otherwise paks will load from gamedir/r2/paks + for (Mod& mod : g_pModManager->m_LoadedMods) + { + if (!mod.m_bEnabled) + continue; + + // need to get a relative path of mod to mod folder + fs::path modPakPath("./" / mod.m_ModDirectory / "paks"); + + for (ModRpakEntry& pak : mod.Rpaks) + if (pak.m_sLoadAfterPak == pPath) + g_pPakLoadManager->LoadPakAsync((modPakPath / pak.m_sPakName).string().c_str(), ePakLoadSource::CONSTANT); + } +} + void LoadCustomMapPaks(char** pakName, bool* bNeedToFreePakName) { // whether the vanilla game has this rpak @@ -192,6 +209,7 @@ int,, (char* pPath, void* unknownSingleton, int flags, void* pCallback0, void* p // trak the pak g_pPakLoadManager->TrackLoadedPak(ePakLoadSource::UNTRACKED, iPakHandle, nPathHash); + LoadPostloadPaks(pPath); if (bNeedToFreePakName) delete[] pPath; |