mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-10 07:12:03 +00:00
Merge branch 'axis-brake-broken' into 'master'
Fix gamepad axis brake behaviour See merge request KartKrew/Kart-Public!324
This commit is contained in:
commit
80abf38648
1 changed files with 3 additions and 5 deletions
|
@ -1503,22 +1503,20 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
|||
{
|
||||
cmd->buttons |= BT_ACCELERATE;
|
||||
// JOYAXISRANGE is supposed to be 1023 (divide by 1024)
|
||||
forward += ((axis * forwardmove[1]) >> 10)*2;
|
||||
forward += ((axis * forwardmove[1]) / (JOYAXISRANGE-1));
|
||||
}
|
||||
|
||||
axis = JoyAxis(AXISBRAKE, ssplayer);
|
||||
if (InputDown(gc_brake, ssplayer) || (gamepadjoystickmove && axis > 0))
|
||||
{
|
||||
cmd->buttons |= BT_BRAKE;
|
||||
if (cmd->buttons & BT_ACCELERATE || cmd->forwardmove <= 0)
|
||||
forward -= forwardmove[0]; // 25 - Halved value so clutching is possible
|
||||
forward -= forwardmove[0]; // 25 - Halved value so clutching is possible
|
||||
}
|
||||
else if (analogjoystickmove && axis > 0)
|
||||
{
|
||||
cmd->buttons |= BT_BRAKE;
|
||||
// JOYAXISRANGE is supposed to be 1023 (divide by 1024)
|
||||
if (cmd->buttons & BT_ACCELERATE || cmd->forwardmove <= 0)
|
||||
forward -= ((axis * forwardmove[0]) >> 10);
|
||||
forward -= ((axis * forwardmove[0]) / (JOYAXISRANGE-1));
|
||||
}
|
||||
|
||||
// But forward/backward IS used for aiming.
|
||||
|
|
Loading…
Reference in a new issue