Only try to load an icon if the filename ends with .wuhb

This commit is contained in:
Maschell 2022-02-14 19:28:56 +01:00
parent 5351af6c46
commit 0e03ccd5b2

View File

@ -326,12 +326,12 @@ DECL_FUNCTION(int, FSOpenFile, FSClient *client, FSCmdBlock *block, char *path,
char *ending = id + 9;
sscanf(id, "%08X", &lowerTitleID);
int32_t idVal = getIDByLowerTitleID(lowerTitleID);
if (idVal < 0) {
DEBUG_FUNCTION_LINE("Failed to find id for titleID %08X", lowerTitleID);
} else {
if (OpenFileForID(idVal, ending, handle) < 0) {
if (idVal >= 0) {
if (StringTools::EndsWith(gFileInfos[idVal].filename, ".wuhb") && OpenFileForID(idVal, ending, handle) < 0) {
return res;
}
} else {
DEBUG_FUNCTION_LINE("Failed to find id for titleID %08X", lowerTitleID);
}
return FS_STATUS_OK;
}