From 3a8ea3cccee06397e90305e1e39a305f8b7c3cb3 Mon Sep 17 00:00:00 2001 From: Jeremy Rimpo Date: Fri, 23 May 2025 14:08:01 -0500 Subject: Oblivion Remastered Meta PR (#2241) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Allow for mod directory maps - Set main data files based on game - Mapped mod directories to VFS - Update overwrite setup * Skip if mod contains no 'data' dir * More mod directory compatibility fixes * Workaround for Obl:Rem save location - SLocalSavePath does nothing yet MO2 wants to use it to override the default save location - This only applies to BGS games anyway, we should move this logic * First pass for overwrite mod directory support * More overwrite move / delete restrictions * Fix issue with moving directories that are not required * Formatting pass * More modDataDirectory updates * Formatting --------- Co-authored-by: Mikaƫl Capelle --- src/shared/directoryentry.cpp | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'src/shared') diff --git a/src/shared/directoryentry.cpp b/src/shared/directoryentry.cpp index 01c325ef..6351083b 100644 --- a/src/shared/directoryentry.cpp +++ b/src/shared/directoryentry.cpp @@ -24,6 +24,7 @@ along with Mod Organizer. If not, see . #include "originconnection.h" #include "util.h" #include "windows_error.h" +#include #include #include @@ -630,19 +631,21 @@ void DirectoryEntry::addFiles(env::DirectoryWalker& walker, FilesOrigin& origin, Context cx = {origin, stats}; cx.current.push(this); - walker.forEachEntry( - path, &cx, - [](void* pcx, std::wstring_view path) { - onDirectoryStart((Context*)pcx, path); - }, + if (std::filesystem::exists(path)) { + walker.forEachEntry( + path, &cx, + [](void* pcx, std::wstring_view path) { + onDirectoryStart((Context*)pcx, path); + }, - [](void* pcx, std::wstring_view path) { - onDirectoryEnd((Context*)pcx, path); - }, + [](void* pcx, std::wstring_view path) { + onDirectoryEnd((Context*)pcx, path); + }, - [](void* pcx, std::wstring_view path, FILETIME ft, uint64_t) { - onFile((Context*)pcx, path, ft); - }); + [](void* pcx, std::wstring_view path, FILETIME ft, uint64_t) { + onFile((Context*)pcx, path, ft); + }); + } } void DirectoryEntry::onDirectoryStart(Context* cx, std::wstring_view path) -- cgit v1.3.1