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:
John Peterson
2009-02-10 20:20:52 +00:00
parent c1214d2026
commit 5ba51ed789
3 changed files with 20 additions and 5 deletions

View File

@ -365,10 +365,13 @@ void SingleShake(u8 &_z, u8 &_y)
// ------------------------------------------
/* Tilting Wiimote with gamepad. We can guess that the game will calculate a Wiimote pitch and use it as a
measure of the tilting of the Wiimote. We are interested in this tilting range
90<EFBFBD> to -90<39> */
90<39> to -90<39> */
// ---------------
void TiltWiimoteGamepad(u8 &_y, u8 &_z)
{
// Return if we have no pads
if (NumGoodPads == 0) return;
// Update the pad state
const int Page = 0;
WiiMoteEmu::GetJoyState(PadState[Page], PadMapping[Page], Page, joyinfo[PadMapping[Page].ID].NumButtons);