diff options
author | Gilles Roudiere <gilles.roudiere@gmail.com> | 2018-04-18 21:38:52 +0200 |
---|---|---|
committer | Gilles Roudiere <gilles.roudiere@gmail.com> | 2018-04-18 21:38:52 +0200 |
commit | 7e89dc432c8781114f4855d6d2f24675a5a1ce5f (patch) | |
tree | c872f67e4b5fe9fd4d3bb9f2943a3d40c48c0371 /core/os/input_event.cpp | |
parent | 9ce8d8ddda35cda781364e9b648325a2953d3f63 (diff) |
Fixes left/up axis not mappable as actions
Diffstat (limited to 'core/os/input_event.cpp')
-rw-r--r-- | core/os/input_event.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<InputEvent> &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; } |