mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-17 10:11:12 +00:00
use R_PointToDist2 to avoid an overflow when walls glitch out and you can accelerate into them endlessly
This commit is contained in:
parent
ba9ca32c54
commit
d860202b8a
1 changed files with 1 additions and 1 deletions
|
@ -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
|
if (!onground) return 0; // If the player isn't on the ground, there is no change in speed
|
||||||
|
|
||||||
// ACCELCODE!!!1!11!
|
// 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);
|
newspeed = FixedDiv(FixedDiv(FixedMul(oldspeed, accelmax - p_accel) + FixedMul(p_speed, p_accel), accelmax), ORIG_FRICTION);
|
||||||
finalspeed = newspeed - oldspeed;
|
finalspeed = newspeed - oldspeed;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue