From e1990e26451a556ee20f91da39b0dbf8d1030a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Lam?= Date: Sat, 17 Jun 2017 22:39:08 +0200 Subject: [PATCH] IOS/ES: Fix title ordering On a real Wii, the title list is not in any particular order. However, because of how the flash filesystem works, titles such as 1-2 are *never* in the first position. We must keep this behaviour, or some versions of the System Menu may break. --- Source/Core/Core/IOS/ES/NandUtils.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/Core/Core/IOS/ES/NandUtils.cpp b/Source/Core/Core/IOS/ES/NandUtils.cpp index 4bbbbfbb65..b82d5daae4 100644 --- a/Source/Core/Core/IOS/ES/NandUtils.cpp +++ b/Source/Core/Core/IOS/ES/NandUtils.cpp @@ -6,6 +6,7 @@ #include #include #include +#include #include #include #include @@ -89,6 +90,12 @@ static std::vector GetTitlesInTitleOrImport(const std::string& titles_dir) } } + // On a real Wii, the title list is not in any particular order. However, because of how + // the flash filesystem works, titles such as 1-2 are *never* in the first position. + // We must keep this behaviour, or some versions of the System Menu may break. + + std::sort(title_ids.begin(), title_ids.end(), std::greater<>()); + return title_ids; }