Skip to content

Commit

Permalink
[rcore] Fix raysan5#4405 (raysan5#4420)
Browse files Browse the repository at this point in the history
* Fix raysan5#4405 at runtime

* Add parameter validation

* Remove default global deadzone
  • Loading branch information
asdqwe authored and psxdev committed Nov 18, 2024
1 parent dcce258 commit d41e8ff
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/rcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -3369,8 +3369,7 @@ float GetGamepadAxisMovement(int gamepad, int axis)
if ((gamepad < MAX_GAMEPADS) && CORE.Input.Gamepad.ready[gamepad] && (axis < MAX_GAMEPAD_AXIS)) {
float movement = value < 0.0f ? CORE.Input.Gamepad.axisState[gamepad][axis] : fabsf(CORE.Input.Gamepad.axisState[gamepad][axis]);

// 0.1f = GAMEPAD_AXIS_MINIMUM_DRIFT/DELTA
if (movement > value + 0.1f) value = CORE.Input.Gamepad.axisState[gamepad][axis];
if (movement > value) value = CORE.Input.Gamepad.axisState[gamepad][axis];
}

return value;
Expand Down

0 comments on commit d41e8ff

Please sign in to comment.