From 94b321822d224116889300c0ee8c3b226a1cfea8 Mon Sep 17 00:00:00 2001 From: Hinsbart Date: Fri, 22 Apr 2016 16:36:45 +0200 Subject: [PATCH] add sign comparison for joystick axis events in InputMap::_find_event fixes #4400 (cherry picked from commit 3b12f9ea8254e6c979e14b6cc5241edbff5c797a) --- core/input_map.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/input_map.cpp b/core/input_map.cpp index 5a9b0357717..17e98902a15 100644 --- a/core/input_map.cpp +++ b/core/input_map.cpp @@ -106,7 +106,7 @@ List::Element *InputMap::_find_event(List &p_list,const } break; case InputEvent::JOYSTICK_MOTION: { - same=(e.joy_motion.axis==p_event.joy_motion.axis); + same=(e.joy_motion.axis==p_event.joy_motion.axis && (e.joy_motion.axis_value < 0) == (p_event.joy_motion.axis_value < 0)); } break; }