mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
Divide G_PlayerInputAnalog values by JOYAXISRANGE
Previously right shifted by 10, which should've been equivalent to divide by 1024. It returned -799 or 800 for a full turn in either direction though. This commit lets turning values reach KART_FULLTURN in either direction.
This commit is contained in:
parent
ff629a4c78
commit
3d2f6770a5
1 changed files with 4 additions and 4 deletions
|
|
@ -1100,7 +1100,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||||
|
|
||||||
if (joystickvector.xaxis != 0)
|
if (joystickvector.xaxis != 0)
|
||||||
{
|
{
|
||||||
cmd->turning -= (joystickvector.xaxis * KART_FULLTURN) >> 10;
|
cmd->turning -= (joystickvector.xaxis * KART_FULLTURN) / JOYAXISRANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->spectator || objectplacing) // SRB2Kart: spectators need special controls
|
if (player->spectator || objectplacing) // SRB2Kart: spectators need special controls
|
||||||
|
|
@ -1132,20 +1132,20 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
|
||||||
if (value != 0)
|
if (value != 0)
|
||||||
{
|
{
|
||||||
cmd->buttons |= BT_ACCELERATE;
|
cmd->buttons |= BT_ACCELERATE;
|
||||||
forward += ((value * MAXPLMOVE) >> 10);
|
forward += ((value * MAXPLMOVE) / JOYAXISRANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
value = G_PlayerInputAnalog(forplayer, gc_brake, 0);
|
value = G_PlayerInputAnalog(forplayer, gc_brake, 0);
|
||||||
if (value != 0)
|
if (value != 0)
|
||||||
{
|
{
|
||||||
cmd->buttons |= BT_BRAKE;
|
cmd->buttons |= BT_BRAKE;
|
||||||
forward -= ((value * MAXPLMOVE) >> 10);
|
forward -= ((value * MAXPLMOVE) / JOYAXISRANGE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// But forward/backward IS used for aiming.
|
// But forward/backward IS used for aiming.
|
||||||
if (joystickvector.yaxis != 0)
|
if (joystickvector.yaxis != 0)
|
||||||
{
|
{
|
||||||
cmd->throwdir -= (joystickvector.yaxis * KART_FULLTURN) >> 10;
|
cmd->throwdir -= (joystickvector.yaxis * KART_FULLTURN) / JOYAXISRANGE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue