fix crash bug when saving some wiimote config

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@3662 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-07-03 18:26:57 +00:00
parent 936225eee4
commit 7ec0a3a5e8
1 changed files with 1 additions and 3 deletions

View File

@ -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);
}