mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Re-enable the speed cap
Only in midair to prevent pogo jump acceleration to infinity.
This commit is contained in:
parent
682a8f6829
commit
00ec2b5f16
1 changed files with 21 additions and 17 deletions
38
src/p_user.c
38
src/p_user.c
|
|
@ -4184,31 +4184,35 @@ static void P_3dMovement(player_t *player)
|
|||
// If "no" to 2, normalize to topspeed, so we can't suddenly run faster than it of our own accord.
|
||||
// If "no" to 1, we're not reaching any limits yet, so ignore this entirely!
|
||||
// -Shadow Hog
|
||||
/*
|
||||
newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
|
||||
if (newMagnitude > K_GetKartSpeed(player, true)) //topspeed)
|
||||
// Only do this forced cap of speed when in midair, the kart acceleration code takes into account friction, and
|
||||
// doesn't let you accelerate past top speed, so this is unnecessary on the ground, but in the air is needed to
|
||||
// allow for being able to change direction on spring jumps without being accelerated into the void - Sryder
|
||||
if (!P_IsObjectOnGround(player->mo))
|
||||
{
|
||||
fixed_t tempmomx, tempmomy;
|
||||
if (oldMagnitude > K_GetKartSpeed(player, true))
|
||||
newMagnitude = R_PointToDist2(player->mo->momx - player->cmomx, player->mo->momy - player->cmomy, 0, 0);
|
||||
if (newMagnitude > K_GetKartSpeed(player, true)) //topspeed)
|
||||
{
|
||||
if (newMagnitude > oldMagnitude)
|
||||
fixed_t tempmomx, tempmomy;
|
||||
if (oldMagnitude > K_GetKartSpeed(player, true))
|
||||
{
|
||||
tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), oldMagnitude);
|
||||
tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), oldMagnitude);
|
||||
if (newMagnitude > oldMagnitude)
|
||||
{
|
||||
tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), oldMagnitude);
|
||||
tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), oldMagnitude);
|
||||
player->mo->momx = tempmomx + player->cmomx;
|
||||
player->mo->momy = tempmomy + player->cmomy;
|
||||
}
|
||||
// else do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), K_GetKartSpeed(player, true)); //topspeed)
|
||||
tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), K_GetKartSpeed(player, true)); //topspeed)
|
||||
player->mo->momx = tempmomx + player->cmomx;
|
||||
player->mo->momy = tempmomy + player->cmomy;
|
||||
}
|
||||
// else do nothing
|
||||
}
|
||||
else
|
||||
{
|
||||
tempmomx = FixedMul(FixedDiv(player->mo->momx - player->cmomx, newMagnitude), K_GetKartSpeed(player, true)); //topspeed)
|
||||
tempmomy = FixedMul(FixedDiv(player->mo->momy - player->cmomy, newMagnitude), K_GetKartSpeed(player, true)); //topspeed)
|
||||
player->mo->momx = tempmomx + player->cmomx;
|
||||
player->mo->momy = tempmomy + player->cmomy;
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue