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
This commit is contained in:
parent
8bc96cc146
commit
c433d83d81
1 changed files with 1 additions and 1 deletions
|
|
@ -637,7 +637,7 @@ bool InputEventJoypadMotion::action_match(const Ref<InputEvent> &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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue