From 68324881173eba803f7b9251545b157e050be4b9 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 19 Mar 2023 18:00:18 +0000 Subject: [PATCH] G_MapEventsToControls: On second thought, only handle reassignment when a trigger axis is activated, to closer match button behaviour. --- src/g_input.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/g_input.c b/src/g_input.c index 4ba238ae4..4ed812c81 100644 --- a/src/g_input.c +++ b/src/g_input.c @@ -467,21 +467,21 @@ void G_MapEventsToControls(event_t *ev) i = ev->data1; - if (AutomaticControllerReassignmentIsAllowed(ev->device) - && (abs(ev->data2) > JOYAXISRANGE/2 || abs(ev->data3) > JOYAXISRANGE/2)) - { - INT32 assigned = AssignDeviceToFirstUnassignedPlayer(ev->device); - if (assigned >= 0) - { - CONS_Alert(CONS_NOTICE, "Player %d device was reassigned\n", assigned + 1); - } - } - if (i >= JOYANALOGS) { // The trigger axes are handled specially. i -= JOYANALOGS; + if (AutomaticControllerReassignmentIsAllowed(ev->device) + && (abs(ev->data2) > JOYAXISRANGE/2 || abs(ev->data3) > JOYAXISRANGE/2)) + { + INT32 assigned = AssignDeviceToFirstUnassignedPlayer(ev->device); + if (assigned >= 0) + { + CONS_Alert(CONS_NOTICE, "Player %d device was reassigned\n", assigned + 1); + } + } + if (ev->data2 != INT32_MAX) { DeviceGameKeyDownArray[KEY_AXIS1 + (JOYANALOGS * 4) + (i * 2)] = max(0, ev->data2);