diff options
| author | Tillmann Karras <tilkax@gmail.com> | 2015-06-02 00:31:02 +0200 |
|---|---|---|
| committer | Tillmann Karras <tilkax@gmail.com> | 2015-06-02 00:31:02 +0200 |
| commit | b96f0fad5710feffbee76b777a46abd91a1c8be7 (patch) | |
| tree | e4168d7c0b92f0d6027123e1672cf2b3f72c68cc /Source | |
| parent | 1414221bd46fbb51f02e686254b3407a9108dd0f (diff) | |
WiimoteReal: fix multiple Wiimotes on OS X
Diffstat (limited to 'Source')
| -rw-r--r-- | Source/Core/Core/HW/WiimoteReal/IOdarwin.mm | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm b/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm index 5c157389ee..253c93b5a2 100644 --- a/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm +++ b/Source/Core/Core/HW/WiimoteReal/IOdarwin.mm @@ -322,11 +322,12 @@ void WiimoteDarwin::DisablePowerAssertionInternal() for (int i = 0; i < MAX_WIIMOTES; i++) { - if (WiimoteReal::g_wiimotes[i] == nullptr) - continue; wm = static_cast<WiimoteReal::WiimoteDarwin*>(WiimoteReal::g_wiimotes[i]); - if ([device isEqual: wm->m_btd] != TRUE) - wm = nullptr; + if (!wm) + continue; + if ([device isEqual: wm->m_btd]) + break; + wm = nullptr; } if (wm == nullptr) { @@ -361,11 +362,12 @@ void WiimoteDarwin::DisablePowerAssertionInternal() for (int i = 0; i < MAX_WIIMOTES; i++) { - if (WiimoteReal::g_wiimotes[i] == nullptr) - continue; wm = static_cast<WiimoteReal::WiimoteDarwin*>(WiimoteReal::g_wiimotes[i]); - if ([device isEqual: wm->m_btd] != TRUE) - wm = nullptr; + if (!wm) + continue; + if ([device isEqual: wm->m_btd]) + break; + wm = nullptr; } if (wm == nullptr) { |
