Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FindWiimotes always returns false #35

Open
greg-hanes opened this issue Sep 29, 2016 · 0 comments
Open

FindWiimotes always returns false #35

greg-hanes opened this issue Sep 29, 2016 · 0 comments

Comments

@greg-hanes
Copy link

Method _FindWiimotes(WiimoteType type) at line 43 initializes a variable called found to be false, and returns the variable without assigning to it.

The variable found should be assigned true at line 86 within the scope of the if (remote == null) statement.

Note: if this is corrected, it will introduce a bug at line 39 in FindWiimotes.

The call to _FindWiimote in the statement "ret = ret || _FindWiimotes(WiimoteType.WIIMOTEPLUS" will only be executed if the value of ret is false (which it always is, erroneously).

The code in FindWiimotes() should be something like

bool ret1 = _FindWiimotes(WiimoteType.WIIMOTE);
bool ret2 = _FindWiimotes(WiimoteType.WIIMOTEPLUS);
return ret1 || ret2;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant