From c433d83d810222200410cdddaf0c0326d636e8f4 Mon Sep 17 00:00:00 2001 From: Patrick Yates Date: Sat, 21 Oct 2017 16:06:24 +1100 Subject: [PATCH] Fix InputEventJoypadMotion::action_match for 0 axis values. Make action_match ignore the sign if axis value is 0. This means that an axis value of 0 will match actions defined for both positive and negative values, as expected. Fixes #12223 --- core/os/input_event.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/os/input_event.cpp b/core/os/input_event.cpp index bef98ac3f2a..6b43f2c63b2 100644 --- a/core/os/input_event.cpp +++ b/core/os/input_event.cpp @@ -637,7 +637,7 @@ bool InputEventJoypadMotion::action_match(const Ref &p_event) const if (jm.is_null()) return false; - return (axis == jm->axis && (axis_value < 0) == (jm->axis_value < 0)); + return (axis == jm->axis && ((axis_value < 0) == (jm->axis_value < 0) || jm->axis_value == 0)); } String InputEventJoypadMotion::as_text() const {