Always mixing up binary and and boolean and...
This commit is contained in:
parent
1c1ddc9381
commit
914c4d3066
|
@ -204,7 +204,7 @@ void ARVRController::_notification(int p_what) {
|
||||||
int mask = 1;
|
int mask = 1;
|
||||||
// check button states
|
// check button states
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
bool was_pressed = (button_states && mask) == mask;
|
bool was_pressed = (button_states & mask) == mask;
|
||||||
bool is_pressed = Input::get_singleton()->is_joy_button_pressed(joy_id, i);
|
bool is_pressed = Input::get_singleton()->is_joy_button_pressed(joy_id, i);
|
||||||
|
|
||||||
if (!was_pressed && is_pressed) {
|
if (!was_pressed && is_pressed) {
|
||||||
|
@ -336,6 +336,7 @@ String ARVRController::get_configuration_warning() const {
|
||||||
ARVRController::ARVRController() {
|
ARVRController::ARVRController() {
|
||||||
controller_id = 0;
|
controller_id = 0;
|
||||||
is_active = true;
|
is_active = true;
|
||||||
|
button_states = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
ARVRController::~ARVRController(){
|
ARVRController::~ARVRController(){
|
||||||
|
|
Loading…
Reference in New Issue