From b0fc4b6ac94454f92c9914180e721cb3a85f3d50 Mon Sep 17 00:00:00 2001 From: RolandMunsil Date: Tue, 5 Aug 2014 20:07:23 -0700 Subject: [PATCH] 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.