G_MapEventsToControls: Permit automagic controller reassignment for axis events greater than JOYAXISRANGE/2

The author of this commit uses a trigger for A(ccel) and was being misled by the absence of response.
This commit is contained in:
toaster 2023-03-19 17:17:50 +00:00
parent 5a7f7b58f0
commit 22294c2c4d

View file

@ -467,6 +467,16 @@ 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.