Don't multiply driftturn by realtics

(I also moved multiplying angleturn to a single spot)
This commit is contained in:
fickleheart 2019-01-15 20:19:25 -06:00
parent 0121d47049
commit e30222ebac

View file

@ -1352,27 +1352,27 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
// let movement keys cancel each other out
if (turnright && !(turnleft))
{
cmd->angleturn = (INT16)(cmd->angleturn - (angleturn[tspeed] * realtics));
cmd->driftturn = (INT16)(cmd->driftturn - (angleturn[tspeed] * realtics));
cmd->angleturn = (INT16)(cmd->angleturn - (angleturn[tspeed]));
cmd->driftturn = (INT16)(cmd->driftturn - (angleturn[tspeed]));
}
else if (turnleft && !(turnright))
{
cmd->angleturn = (INT16)(cmd->angleturn + (angleturn[tspeed] * realtics));
cmd->driftturn = (INT16)(cmd->driftturn + (angleturn[tspeed] * realtics));
cmd->angleturn = (INT16)(cmd->angleturn + (angleturn[tspeed]));
cmd->driftturn = (INT16)(cmd->driftturn + (angleturn[tspeed]));
}
if (analogjoystickmove && axis != 0)
{
// JOYAXISRANGE should be 1023 (divide by 1024)
cmd->angleturn = (INT16)(cmd->angleturn - (((axis * angleturn[1]) >> 10) * realtics)); // ANALOG!
cmd->driftturn = (INT16)(cmd->driftturn - (((axis * angleturn[1]) >> 10) * realtics));
cmd->angleturn = (INT16)(cmd->angleturn - (((axis * angleturn[1]) >> 10))); // ANALOG!
cmd->driftturn = (INT16)(cmd->driftturn - (((axis * angleturn[1]) >> 10)));
}
// Specator mouse turning
if (player->spectator)
{
cmd->angleturn = (INT16)(cmd->angleturn - ((mousex*(encoremode ? -1 : 1)*8) * realtics));
cmd->driftturn = (INT16)(cmd->driftturn - ((mousex*(encoremode ? -1 : 1)*8) * realtics));
cmd->angleturn = (INT16)(cmd->angleturn - ((mousex*(encoremode ? -1 : 1)*8)));
cmd->driftturn = (INT16)(cmd->driftturn - ((mousex*(encoremode ? -1 : 1)*8)));
}
// Speed bump strafing
@ -1549,19 +1549,21 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
//{ SRB2kart - Drift support
// Not grouped with the rest of turn stuff because it needs to know what buttons you're pressing for rubber-burn turn
// limit turning to angleturn[1] to stop mouselook letting you look too fast
if (cmd->angleturn > (angleturn[1] * realtics))
cmd->angleturn = (angleturn[1] * realtics);
else if (cmd->angleturn < (-angleturn[1] * realtics))
cmd->angleturn = (-angleturn[1] * realtics);
if (cmd->angleturn > (angleturn[1]))
cmd->angleturn = (angleturn[1]);
else if (cmd->angleturn < (-angleturn[1]))
cmd->angleturn = (-angleturn[1]);
if (cmd->driftturn > (angleturn[1] * realtics))
cmd->driftturn = (angleturn[1] * realtics);
else if (cmd->driftturn < (-angleturn[1] * realtics))
cmd->driftturn = (-angleturn[1] * realtics);
if (cmd->driftturn > (angleturn[1]))
cmd->driftturn = (angleturn[1]);
else if (cmd->driftturn < (-angleturn[1]))
cmd->driftturn = (-angleturn[1]);
if (player->mo)
cmd->angleturn = K_GetKartTurnValue(player, cmd->angleturn);
cmd->angleturn *= realtics;
// SRB2kart - no additional angle if not moving
if (((player->mo && player->speed > 0) // Moving
|| (leveltime > starttime && (cmd->buttons & BT_ACCELERATE && cmd->buttons & BT_BRAKE)) // Rubber-burn turn