From 922ea1235e1637bd6636bedb6547796a876c3f46 Mon Sep 17 00:00:00 2001 From: NepDisk <16447892+NepDisk@users.noreply.github.com> Date: Thu, 12 Sep 2024 18:25:38 -0400 Subject: [PATCH] Revert "Merge branch 'natural-camera-outrun' into 'master'" This reverts commit 57e69603a4ed39fd6c2dfef6eb9d7c031d99e6f9, reversing changes made to 542e0b88dfbc56fbc4272fe65d987547e9dfae3b. --- src/p_user.c | 59 +++++++++++++++------------------------------------- 1 file changed, 17 insertions(+), 42 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index dba95d171..f50cfec57 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3293,48 +3293,25 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall } // sets ideal cam pos + dist = camdist; + + /* player->speed subtracts conveyors, janks up the camera */ + if (player->loop.radius) { - const fixed_t speedthreshold = 48*mapobjectscale; - const fixed_t olddist = P_AproxDistance(mo->x - thiscam->x, mo->y - thiscam->y); - - fixed_t lag, distoffset; - - dist = camdist; - - if (player->karthud[khud_boostcam]) - { - dist -= FixedMul(11*dist/16, player->karthud[khud_boostcam]); - } - - if (player->loop.radius) - { - speed = player->speed; - } - else - { - speed = P_AproxDistance(P_AproxDistance(mo->momx, mo->momy), mo->momz / 16); - } - - lag = FRACUNIT - ((FixedDiv(speed, speedthreshold) - FRACUNIT) * 2); - - if (lag > FRACUNIT) - { - lag = FRACUNIT; - } - - if (lag < camspeed) - { - lag = camspeed; - } - - distoffset = dist - olddist; - dist = olddist + FixedMul(distoffset, lag); - - if (dist < 0) - { - dist = 0; - } + speed = player->speed; } + else + { + speed = R_PointToDist2(0, 0, player->mo->momx, player->mo->momy); + } + + + if (speed > K_GetKartSpeed(player, false, true)) + dist += 4*(speed - K_GetKartSpeed(player, false, true)); + dist += abs(thiscam->momz)/4; + + if (player->karthud[khud_boostcam]) + dist -= FixedMul(11*dist/16, player->karthud[khud_boostcam]); if (mo->standingslope) { @@ -3625,9 +3602,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall thiscam->momz = 0; } else if (player->exiting || timeover == 2) - { thiscam->momx = thiscam->momy = thiscam->momz = 0; - } else if (leveltime < introtime) { thiscam->momx = FixedMul(x - thiscam->x, camspeed);