From fcf99d8f7896e8c84944995a539142af36ea56ff Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Sat, 18 Mar 2023 21:36:05 +0100 Subject: [PATCH] Fix bug caused by loading certain paths from mod Don't attempt to load absolute file paths from the mod directory. --- r5dev/filesystem/basefilesystem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/r5dev/filesystem/basefilesystem.cpp b/r5dev/filesystem/basefilesystem.cpp index 49161a59..1a9d6d26 100644 --- a/r5dev/filesystem/basefilesystem.cpp +++ b/r5dev/filesystem/basefilesystem.cpp @@ -66,13 +66,19 @@ bool CBaseFileSystem::VCheckDisk(const char* pszFilePath) } std::string svFilePath = ConvertToWinPath(pszFilePath); - if (svFilePath.find("\\*\\") != string::npos) { // Erase '//*/'. svFilePath.erase(0, 4); } + fs::path filePath(svFilePath); + if (filePath.is_absolute()) + { + // Skip absolute file paths. + return false; + } + // TODO: obtain 'mod' SearchPath's instead. svFilePath.insert(0, "platform\\");