G_MapEventsToControls: On second thought, only handle reassignment when a trigger axis is activated, to closer match button behaviour.

This commit is contained in:
toaster 2023-03-19 18:00:18 +00:00
parent 1acf00daa6
commit 6832488117

View file

@ -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);