From 8cac1a83607c37219a31d197b3162f70a527be2c Mon Sep 17 00:00:00 2001 From: William JCM Date: Wed, 24 Jun 2020 10:02:30 +0200 Subject: [PATCH] MainFrame: fix crash when cancelling a dialog. --- GUI/EvtMainFrame.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GUI/EvtMainFrame.cpp b/GUI/EvtMainFrame.cpp index 8ec424e..d9cfa48 100644 --- a/GUI/EvtMainFrame.cpp +++ b/GUI/EvtMainFrame.cpp @@ -142,7 +142,7 @@ void EvtMainFrame::moveMassEvent(wxCommandEvent&) { "- If the destination already contains a M.A.S.S., the two will be swapped.\n" "- If the destination contains invalid data, it will be cleared first.", *(_manager.massName(source_slot))), - "Slot", "Choose a slot", source_slot + 1, 1, 32, this) - 1; + "Slot", "Choose a slot", source_slot + 1, 1, 32, this); if(choice == -1 || choice == source_slot) { return; @@ -153,7 +153,7 @@ void EvtMainFrame::moveMassEvent(wxCommandEvent&) { errorMessage(error_prefix + "For security reasons, moving a M.A.S.S. is disabled if the game's status is unknown."); break; case GameState::NotRunning: - if(!_manager.moveMass(source_slot, choice)) { + if(!_manager.moveMass(source_slot, choice - 1)) { errorMessage(error_prefix + _manager.lastError()); } break;