Adjust acceleration for rubberbanding

Since your acceleration is tied to your top speed, we need to do this to ensure we're ONLY increasing the top speed, and not how fast they make it to that top speed.
This commit is contained in:
Sally Coolatta 2022-05-26 00:25:54 -04:00
parent 8815b065b3
commit 2cbcc8f914

View file

@ -3298,11 +3298,18 @@ fixed_t K_GetNewSpeed(player_t *player)
{
const fixed_t accelmax = 4000;
const fixed_t p_speed = K_GetKartSpeed(player, true, true);
const fixed_t p_accel = K_GetKartAccel(player);
fixed_t p_accel = K_GetKartAccel(player);
fixed_t newspeed, oldspeed, finalspeed;
oldspeed = R_PointToDist2(0, 0, player->rmomx, player->rmomy); // FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale);
if (K_PlayerUsesBotMovement(player) == true && player->botvars.rubberband > 0)
{
// Acceleration is tied to top speed...
// so if we want JUST a top speed boost, we have to do this...
p_accel = FixedDiv(p_accel, player->botvars.rubberband);
}
oldspeed = R_PointToDist2(0, 0, player->rmomx, player->rmomy);
// Don't calculate the acceleration as ever being above top speed
if (oldspeed > p_speed)
oldspeed = p_speed;