Gamepad (minor) > Crashfix in Wiimote plugin

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4554 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
John Peterson 2009-11-13 09:11:24 +00:00
parent 173c16ad41
commit 928dc99874
2 changed files with 4 additions and 3 deletions

View File

@ -82,7 +82,7 @@ void WiimotePadConfigDialog::SaveButtonMappingAll(int Slot)
{
for (int i = 0; i < MAX_WIIMOTES; i++)
{
if (WiiMoteEmu::IDToName(WiiMoteEmu::PadMapping[i].ID) == WiiMoteEmu::IDToName(WiiMoteEmu::PadMapping[Slot].ID))
if (WiiMoteEmu::PadMapping[i].Name.length() > 0 && WiiMoteEmu::PadMapping[i].Name == WiiMoteEmu::PadMapping[Slot].Name)
SaveButtonMapping(i, false, Slot);
}
}
@ -204,6 +204,7 @@ void WiimotePadConfigDialog::SaveButtonMapping(int controller, bool DontChangeId
a blank selection. */
if (!DontChangeId)
{
if (m_Joyname[FromSlot]->GetSelection() >= WiiMoteEmu::joyinfo.size()) PanicAlert("Bug in SaveButtonMapping");
WiiMoteEmu::PadMapping[controller].ID = WiiMoteEmu::joyinfo.at(m_Joyname[FromSlot]->GetSelection()).ID;
WiiMoteEmu::PadMapping[controller].Name = m_Joyname[FromSlot]->GetValue().mb_str();
}

View File

@ -437,7 +437,7 @@ void PADConfigDialognJoy::SaveButtonMappingAll(int Slot)
{
for (int i = 0; i < 4; i++)
{
if (IDToName(PadMapping[i].ID) == IDToName(PadMapping[Slot].ID))
if (PadMapping[i].Name.length() > 0 && PadMapping[i].Name == PadMapping[Slot].Name)
SaveButtonMapping(i, false, Slot);
}
}