use R_PointToDist2 to avoid an overflow when walls glitch out and you can accelerate into them endlessly

This commit is contained in:
Sryder 2017-03-05 23:24:17 +00:00
parent ba9ca32c54
commit d860202b8a
1 changed files with 1 additions and 1 deletions

View File

@ -1155,7 +1155,7 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, boolean forwardmove
if (!onground) return 0; // If the player isn't on the ground, there is no change in speed
// ACCELCODE!!!1!11!
oldspeed = P_AproxDistance(player->rmomx, player->rmomy); // FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale);
oldspeed = R_PointToDist2(0, 0, player->rmomx, player->rmomy); // FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale);
newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), ORIG_FRICTION);
finalspeed = newspeed - oldspeed;