From f324dad6fecf3a77b480487c1db8edaf39eebbe6 Mon Sep 17 00:00:00 2001 From: Maschell Date: Mon, 29 Aug 2022 01:01:11 +0200 Subject: [PATCH] Fix saving the correct autoboot option --- source/BootUtils.cpp | 1 - source/MenuUtils.cpp | 8 ++++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/BootUtils.cpp b/source/BootUtils.cpp index 0e31c2e..191a884 100644 --- a/source/BootUtils.cpp +++ b/source/BootUtils.cpp @@ -145,7 +145,6 @@ uint64_t getVWiiHBLTitleId() { } else { DEBUG_FUNCTION_LINE_ERR("Failed to add FSAClient"); } - DEBUG_FUNCTION_LINE_ERR("%016llX", titleId); return titleId; } diff --git a/source/MenuUtils.cpp b/source/MenuUtils.cpp index 8885fae..5521296 100644 --- a/source/MenuUtils.cpp +++ b/source/MenuUtils.cpp @@ -181,13 +181,13 @@ int32_t handleMenuScreen(std::string &configPath, int32_t autobootOptionInput, c free(screenBuffer); - int32_t selected = 0; - int32_t autoboot = 0; + int32_t selected = -1; + int32_t autoboot = -1; // convert index to key - if (selectedIndex > 0 && (uint32_t) selectedIndex < menu.size()) { + if (selectedIndex >= 0 && (uint32_t) selectedIndex < menu.size()) { selected = std::next(menu.begin(), selectedIndex)->first; } - if (autobootIndex > 0 && (uint32_t) autobootIndex < menu.size()) { + if (autobootIndex >= 0 && (uint32_t) autobootIndex < menu.size()) { autoboot = std::next(menu.begin(), autobootIndex)->first; }