Fix: setting IR to off before handshake completes used to enable it anyway.

Fix via Harald <Gotterdammerung@web.de>
This commit is contained in:
Ryan Pavlik
2010-09-21 15:04:40 -05:00
parent ae74f81c45
commit ff0bfc261d

View File

@@ -74,8 +74,10 @@ void wiiuse_set_ir(struct wiimote_t* wm, int status) {
* again to actually enable IR.
*/
if (!WIIMOTE_IS_SET(wm, WIIMOTE_STATE_HANDSHAKE_COMPLETE)) {
WIIUSE_DEBUG("Tried to enable IR, will wait until handshake finishes.");
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_IR);
if(status) {
WIIUSE_DEBUG("Tried to enable IR, will wait until handshake finishes.");
WIIMOTE_ENABLE_STATE(wm, WIIMOTE_STATE_IR);
} // else ignoring request to turn off, since it's turned off by default
return;
}