mpsetups: bug fix - when deleting a setup that is behind the default setup in the list

This commit is contained in:
Raf committed 2025-03-31 10:25:24 +08:00
1 parent 8f477a36b6
commit 7a98095a0b
1 file changed
+7 -7
+7 -7
View File
@@ -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();