input_joypad_analog_button - only call fabs when input value is not 0

This commit is contained in:
twinaphex 2021-04-15 07:27:43 +02:00
parent 52454591aa
commit 9f902c8bd4
1 changed files with 3 additions and 3 deletions

View File

@ -25116,9 +25116,9 @@ static int16_t input_joypad_analog_button(
{
int16_t mult = 0;
if (axis != AXIS_NONE)
mult = drv->axis(
joypad_info->joy_idx, axis);
normal_mag = fabs((1.0f / 0x7fff) * mult);
if ((mult = drv->axis(
joypad_info->joy_idx, axis)) != 0)
normal_mag = fabs((1.0f / 0x7fff) * mult);
}
/* If the result is zero, it's got a digital button