mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
Wiimote: Fixed crash that would occur if no gamepad was detected
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2211 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -83,7 +83,7 @@ void Config::Load(bool ChangePad)
|
||||
|
||||
/* Prevent a crash from illegal access to joyinfo that will only have values for
|
||||
the current amount of connected PadMapping */
|
||||
if(WiiMoteEmu::PadMapping[i].ID >= SDL_NumJoysticks()) continue;
|
||||
if(WiiMoteEmu::PadMapping[i].ID >= WiiMoteEmu::joyinfo.size()) continue;
|
||||
|
||||
// Create a section name
|
||||
SectionName = WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name;
|
||||
@ -146,7 +146,7 @@ void Config::Save(int Slot)
|
||||
|
||||
/* Save joypad specific settings. Check for "PadMapping[i].ID < SDL_NumJoysticks()" to
|
||||
avoid reading a joyinfo that does't exist */
|
||||
if(WiiMoteEmu::PadMapping[i].ID >= SDL_NumJoysticks()) continue;
|
||||
if(WiiMoteEmu::PadMapping[i].ID >= WiiMoteEmu::joyinfo.size()) continue;
|
||||
|
||||
// Create a new section name after the joypad name
|
||||
SectionName = WiiMoteEmu::joyinfo[WiiMoteEmu::PadMapping[i].ID].Name;
|
||||
|
Reference in New Issue
Block a user