Merge branch 'illegal-digital-maneuver' into 'master'

Diagonal-back for shallow digital turns

See merge request KartKrew/Kart!1600
This commit is contained in:
Oni 2023-11-05 18:45:33 +00:00
commit fc236fa310

View file

@ -372,6 +372,16 @@ class TiccmdBuilder
}
kart_analog_input();
// Digital users can input diagonal-back for shallow turns.
//
// There's probably some principled way of doing this in the gamepad handler itself,
// by only applying this filtering to inputs sourced from an axis. This is a little
// ugly with the current abstractions, though, and there's a fortunate trick here:
// if you can input full strength turns on both axes, either you're using a fucking
// square gate, or you're not on an analog device.
if (joystickvector.yaxis >= JOYAXISRANGE && abs(cmd->turning) == KART_FULLTURN) // >= beacuse some analog devices can go past JOYAXISRANGE (?!)
cmd->turning /= 2;
}
void common_button_input()