From 14abb6020734f58557a2dad3fa28f0821b2d5533 Mon Sep 17 00:00:00 2001 From: Fireblade <72758695+Firebladedoge229@users.noreply.github.com> Date: Fri, 17 Jul 2026 00:02:23 -0400 Subject: [PATCH] fix: 4jlibs debug builds + dlc issues --- CMakeLists.txt | 1 + impls/Windows_Libs/Storage/src/STO_DLC.cpp | 21 +++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 673fa38..6f5a6f1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,7 @@ target_include_directories(4JLibs.Globals INTERFACE ) set(CMAKE_DEBUG_POSTFIX "_d") +add_compile_definitions($<$:_DEBUG>) # msvc specific flags if(MSVC) diff --git a/impls/Windows_Libs/Storage/src/STO_DLC.cpp b/impls/Windows_Libs/Storage/src/STO_DLC.cpp index 9ac9bea..29f6375 100644 --- a/impls/Windows_Libs/Storage/src/STO_DLC.cpp +++ b/impls/Windows_Libs/Storage/src/STO_DLC.cpp @@ -129,21 +129,26 @@ DWORD CDLC::MountInstalledDLC(int iPad, DWORD dwDLC, int (*Func)(LPVOID, int, DW this->m_pMountedDLCParam = lpParam; if (szMountDrive) - { m_szMountPath = szMountDrive; - } else - { m_szMountPath = this->m_szPackageRoot; - } this->m_uiCurrentMappedDLC = dwDLC; char *dlcdirPath = m_vInstalledDLCs[m_uiCurrentMappedDLC].szFileName; + + for (int i = 0; i < (int)m_vDLCDriveMappings.size(); i++) + { + if (m_vDLCDriveMappings[i].m_szMountPath == m_szMountPath) + { + m_vDLCDriveMappings.erase(m_vDLCDriveMappings.begin() + i); + break; + } + } + m_vDLCDriveMappings.push_back(DriveMapping(dlcdirPath, m_szMountPath)); m_iHasNewMountedDLCs = true; - return 997; } @@ -152,17 +157,13 @@ DWORD CDLC::UnmountInstalledDLC(LPCSTR szMountDrive) LPCSTR szDrive = nullptr; if (szMountDrive) - { szDrive = szMountDrive; - } else - { szDrive = this->m_szPackageRoot; - } for (int i = 0; i < this->m_vDLCDriveMappings.size(); i++) { - if (m_vDLCDriveMappings[i].m_szDirectoryPath == szDrive) + if (m_vDLCDriveMappings[i].m_szMountPath == szDrive) { m_vDLCDriveMappings.erase(m_vDLCDriveMappings.begin() + i);