From 7e89dc432c8781114f4855d6d2f24675a5a1ce5f Mon Sep 17 00:00:00 2001 From: Gilles Roudiere Date: Wed, 18 Apr 2018 21:38:52 +0200 Subject: Fixes left/up axis not mappable as actions --- core/os/input_event.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'core/os/input_event.cpp') diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index bdb61cbfd9..5003be77ab 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -656,10 +656,10 @@ bool InputEventJoypadMotion::action_match(const Ref &p_event, bool * if (jm.is_null()) return false; - bool match = (axis == jm->axis && ((axis_value < 0) == (jm->axis_value < 0) || jm->axis_value == 0)); + bool match = (axis == jm->axis && (((axis_value < 0) == (jm->axis_value < 0)) || jm->axis_value == 0)); if (match) { if (p_pressed != NULL) - *p_pressed = Math::abs(jm->get_axis_value() >= p_deadzone); + *p_pressed = Math::abs(jm->get_axis_value()) >= p_deadzone; if (p_strength != NULL) *p_strength = (*p_pressed) ? Math::inverse_lerp(p_deadzone, 1.0f, Math::abs(jm->get_axis_value())) : 0.0f; } -- cgit v1.2.3