From 922794e7eabe4b70e59bfa904bdf78e2e5b50b53 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Sat, 21 Jun 2025 15:19:25 +0200 Subject: [PATCH] Fix loading files from CD or HD (#357) --- ISLE/isleapp.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ISLE/isleapp.cpp b/ISLE/isleapp.cpp index ae8760ff..6aa68f70 100644 --- a/ISLE/isleapp.cpp +++ b/ISLE/isleapp.cpp @@ -1059,8 +1059,18 @@ MxResult IsleApp::VerifyFilesystem() MxString path(&file[1]); path.MapPathToFilesystem(); - if (!SDL_GetPathInfo(path.GetData(), NULL)) { - char buffer[512]; + const char* searchPaths[] = {".", m_hdPath, m_cdPath}; + char buffer[1024]; + + bool found = false; + for (const char* base : searchPaths) { + SDL_snprintf(buffer, sizeof(buffer), "%s%s", base, path.GetData()); + found = SDL_GetPathInfo(buffer, NULL); + if (found) { + break; + } + } + if (!found) { SDL_snprintf( buffer, sizeof(buffer),