From 0e03ccd5b2b57fef3fc2f301d426d46877f3f83d Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 14 Feb 2022 19:28:56 +0100 Subject: [PATCH] Only try to load an icon if the filename ends with .wuhb --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 8ad95eb..f160848 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -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; }