From 05fadae4bb7f3e9fff19c84ed7baac4feedecff9 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 4e442f591..fa78435d6 100644 --- a/primedev/core/filesystem/rpakfilesystem.cpp +++ b/primedev/core/filesystem/rpakfilesystem.cpp @@ -341,7 +341,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) @@ -349,7 +349,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; } }