Set minimum deadzone for menus and prevent setting deadzone to 0 (c Ashnal)

This commit is contained in:
Lonsfor 2021-09-01 20:23:18 -04:00 committed by Lonsfor
parent 080a4f080a
commit 8724b01ae4
No known key found for this signature in database
GPG key ID: A4B7179A9CA2B527
2 changed files with 2 additions and 2 deletions

View file

@ -421,7 +421,7 @@ static CV_PossibleValue_t joyaxis_cons_t[] = {{0, "None"},
#endif #endif
#endif #endif
static CV_PossibleValue_t deadzone_cons_t[] = {{0, "MIN"}, {FRACUNIT, "MAX"}, {0, NULL}}; static CV_PossibleValue_t deadzone_cons_t[] = {{FRACUNIT/16, "MIN"}, {FRACUNIT, "MAX"}, {0, NULL}};
// don't mind me putting these here, I was lazy to figure out where else I could put those without blowing up the compiler. // don't mind me putting these here, I was lazy to figure out where else I could put those without blowing up the compiler.

View file

@ -2571,7 +2571,7 @@ boolean M_Responder(event_t *ev)
{ {
if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime()) if (ev->type == ev_joystick && ev->data1 == 0 && joywait < I_GetTime())
{ {
const INT32 jdeadzone = ((JOYAXISRANGE-1) * cv_ydeadzone.value) >> FRACBITS; const INT32 jdeadzone = ((JOYAXISRANGE-1) * max(cv_ydeadzone.value, 3*FRACUNIT/4)) >> FRACBITS;
if (ev->data3 != INT32_MAX) if (ev->data3 != INT32_MAX)
{ {
if (Joystick.bGamepadStyle || abs(ev->data3) > jdeadzone) if (Joystick.bGamepadStyle || abs(ev->data3) > jdeadzone)