From 42d97028e1a474e7fecc1de7e76c5d92ecf2c28f Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Sun, 6 Oct 2024 17:01:50 +0100 Subject: [PATCH] Fix rpak aliasing not working when trying to alias towards a vanilla rpak (#825) Replace incorrect variable with hardcoded `-1` Don't account for the modded path in pak aliases --- primedev/core/filesystem/rpakfilesystem.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/primedev/core/filesystem/rpakfilesystem.cpp b/primedev/core/filesystem/rpakfilesystem.cpp index ebb9085a7..c3e5e74ee 100644 --- a/primedev/core/filesystem/rpakfilesystem.cpp +++ b/primedev/core/filesystem/rpakfilesystem.cpp @@ -342,7 +342,7 @@ void PakLoadManager::UnloadDependentPaks(PakHandle handle) static void HandlePakAliases(std::string& originalPath) { // convert the pak being loaded to its aliased one, e.g. aliasing mp_hub_timeshift => sp_hub_timeshift - for (int64_t i = g_pModManager->m_LoadedMods.size() - 1; i > PakHandle::INVALID; i--) + for (int64_t i = g_pModManager->m_LoadedMods.size() - 1; i > -1; i--) { Mod* mod = &g_pModManager->m_LoadedMods[i]; if (!mod->m_bEnabled) @@ -350,7 +350,7 @@ static void HandlePakAliases(std::string& originalPath) if (mod->RpakAliases.find(originalPath) != mod->RpakAliases.end()) { - originalPath = (mod->m_ModDirectory / "paks" / mod->RpakAliases[originalPath]).string(); + originalPath = mod->RpakAliases[originalPath]; return; } }