Welcome! Log In Create A New Profile

Advanced

expansion_t.type is always 0?

Posted by gskw 
expansion_t.type is always 0?
March 08, 2014 03:22PM
I am using the following code:
WPAD_ScanPads();
struct expansion_t ext;
WPAD_Expansion(WPAD_CHAN_0, &ext);
if (ext.type == WPAD_EXP_NONE) return 0;
else if (ext.type == WPAD_EXP_NUNCHUK) return 1;
else if (ext.type == WPAD_EXP_CLASSIC) return 2;
return ext.type;
It seems to always return 0, no matter what expansion I am using. What is wrong with it?



Edited 2 time(s). Last edit at 03/08/2014 03:24PM by gskw.
Re: expansion_t.type is always 0?
March 08, 2014 07:38PM
WPAD_CHAN_0 returns data for player one only. make sure the expansion is connected to the wiimote which is player 1.

also write your if statements like this;

if( ) {
} else
Re: expansion_t.type is always 0?
March 09, 2014 06:55PM
It was connected to Wiimote 1.
Using an official controller fixed the problem.
You can use "if () //statements" when there is only one statement.
Sorry, only registered users may post in this forum.

Click here to login