From b0fc4b6ac94454f92c9914180e721cb3a85f3d50 Mon Sep 17 00:00:00 2001 From: RolandMunsil Date: Tue, 5 Aug 2014 20:07:23 -0700 Subject: [PATCH 1/2] Fix "bad wxCheckListBox index" warning when trying to create AR Code Fixes issue [7060](https://code.google.com/p/dolphin-emu/issues/detail?id=7060) --- Source/Core/DolphinWX/ISOProperties.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/ISOProperties.cpp b/Source/Core/DolphinWX/ISOProperties.cpp index 762ad08dc0..e1b4a9f60c 100644 --- a/Source/Core/DolphinWX/ISOProperties.cpp +++ b/Source/Core/DolphinWX/ISOProperties.cpp @@ -1371,9 +1371,11 @@ void CISOProperties::ActionReplayList_Save() std::vector lines; std::vector enabledLines; u32 index = 0; + u32 cheats_chkbox_count = Cheats->GetCount(); for (const ActionReplay::ARCode& code : arCodes) { - if (Cheats->IsChecked(index)) + //Check the index against the count because of the hacky way codes are added from the "Cheat Search" dialog + if ((index < cheats_chkbox_count) && Cheats->IsChecked(index)) enabledLines.push_back("$" + code.name); // Do not save default cheats. From b94069b5af9e15e26ff0cb9883427141561f36ae Mon Sep 17 00:00:00 2001 From: RolandMunsil Date: Tue, 5 Aug 2014 20:45:18 -0700 Subject: [PATCH 2/2] Update ISOProperties.cpp --- Source/Core/DolphinWX/ISOProperties.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Core/DolphinWX/ISOProperties.cpp b/Source/Core/DolphinWX/ISOProperties.cpp index e1b4a9f60c..735d6eea6a 100644 --- a/Source/Core/DolphinWX/ISOProperties.cpp +++ b/Source/Core/DolphinWX/ISOProperties.cpp @@ -1374,7 +1374,7 @@ void CISOProperties::ActionReplayList_Save() u32 cheats_chkbox_count = Cheats->GetCount(); for (const ActionReplay::ARCode& code : arCodes) { - //Check the index against the count because of the hacky way codes are added from the "Cheat Search" dialog + // Check the index against the count because of the hacky way codes are added from the "Cheat Search" dialog if ((index < cheats_chkbox_count) && Cheats->IsChecked(index)) enabledLines.push_back("$" + code.name);