Fix loading files from CD or HD (#357)

This commit is contained in:
Anders Jenbo 2025-06-21 15:19:25 +02:00 committed by GitHub
parent 510d6f312a
commit 922794e7ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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),