From 7a98095a0be2c23d72f0cd273a30c93d0bf93909 Mon Sep 17 00:00:00 2001 From: Raf <> Date: Mon, 31 Mar 2025 10:25:24 +0800 Subject: [PATCH] mpsetups: bug fix - when deleting a setup that is behind the default setup in the list --- port/src/mpsetups.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/port/src/mpsetups.c b/port/src/mpsetups.c index dc9e0fc2e..d347c56e2 100644 --- a/port/src/mpsetups.c +++ b/port/src/mpsetups.c @@ -663,16 +663,16 @@ static s32 deleteSetup() memcpy(dst, src, MPSETUP_BLOCKSIZE); } - if (g_MpCurrentSetup > slotindex) { + if (g_MpCurrentSetup >= slotindex) { g_MpCurrentSetup--; } - else if (g_MpCurrentSetup == slotindex) { - g_MpCurrentSetup = -1; - } - if (g_MpSetupFile.defaultsetup == slotindex + 1) { - g_MpSetupFile.defaultsetup = 0; - } + if (g_MpSetupFile.defaultsetup > slotindex + 1) { + g_MpSetupFile.defaultsetup--; + } + else if (g_MpSetupFile.defaultsetup == slotindex + 1) { + g_MpSetupFile.defaultsetup = 0; + } g_MpSetupFile.numsetups--; return mpsetupSaveCurrentFile();