mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-17 10:11:12 +00:00
Account for conveyor belts with no-accelerate movement
use R_PointToDist2 instead of P_AproxDistance for player->speed, more accurate and probably won't cause too much performance trouble
This commit is contained in:
parent
81fca118fe
commit
8934cf69c7
2 changed files with 4 additions and 5 deletions
|
@ -1009,7 +1009,6 @@ static void K_PlayTauntSound(mobj_t *source)
|
|||
void K_MomentumToFacing(player_t *player)
|
||||
{
|
||||
angle_t dangle = player->mo->angle - R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy);
|
||||
fixed_t speed = R_PointToDist2(0, 0, player->rmomx, player->rmomy);
|
||||
|
||||
if (dangle > ANGLE_180)
|
||||
dangle = InvAngle(dangle);
|
||||
|
@ -1018,9 +1017,9 @@ void K_MomentumToFacing(player_t *player)
|
|||
if (!P_IsObjectOnGround(player->mo) || dangle > ANGLE_90)
|
||||
return;
|
||||
|
||||
P_Thrust(player->mo, player->mo->angle, speed - FixedMul(speed, player->mo->friction));
|
||||
player->mo->momx = FixedMul(player->mo->momx, player->mo->friction);
|
||||
player->mo->momy = FixedMul(player->mo->momy, player->mo->friction);
|
||||
P_Thrust(player->mo, player->mo->angle, player->speed - FixedMul(player->speed, player->mo->friction));
|
||||
player->mo->momx = FixedMul(player->mo->momx - player->cmomx, player->mo->friction) + player->cmomx;
|
||||
player->mo->momy = FixedMul(player->mo->momy - player->cmomy, player->mo->friction) + player->cmomy;
|
||||
}
|
||||
|
||||
// if speed is true it gets the speed boost power, otherwise it gets the acceleration
|
||||
|
|
|
@ -4616,7 +4616,7 @@ static void P_3dMovement(player_t *player)
|
|||
player->rmomy = player->mo->momy - player->cmomy;
|
||||
|
||||
// Calculates player's speed based on distance-of-a-line formula
|
||||
player->speed = P_AproxDistance(player->rmomx, player->rmomy);
|
||||
player->speed = R_PointToDist2(0, 0, player->rmomx, player->rmomy);
|
||||
|
||||
// Monster Iestyn - 04-11-13
|
||||
// Quadrants are stupid, excessive and broken, let's do this a much simpler way!
|
||||
|
|
Loading…
Reference in a new issue