From 7ec0a3a5e845ee22b6ef9c733bfd11b752bcbf60 Mon Sep 17 00:00:00 2001 From: hrydgard Date: Fri, 3 Jul 2009 18:26:57 +0000 Subject: [PATCH] fix crash bug when saving some wiimote config git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3662 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp index f8fb87f990..28ccdfbbe6 100644 --- a/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp +++ b/Source/Plugins/Plugin_Wiimote/Src/ConfigGamepad.cpp @@ -118,12 +118,10 @@ void WiimoteConfigDialog::SetButtonTextAll(int id, char text[128]) void WiimoteConfigDialog::SaveButtonMappingAll(int Slot) { - //INFO_LOG(CONSOLE, "SaveButtonMappingAll()\n"); - for (int i = 0; i < 4; i++) { // This can occur when no gamepad is detected - if ((int)WiiMoteEmu::joyinfo.size() > WiiMoteEmu::PadMapping[i].ID) + if ((int)WiiMoteEmu::joyinfo.size() > WiiMoteEmu::PadMapping[i].ID && WiiMoteEmu::PadMapping[i].ID >= 0) if (WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name == WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[Slot].ID].Name) SaveButtonMapping(i, false, Slot); }