From 39bfad150f4ad4733320130066d1bcafae2d5ba9 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 23 Oct 2018 19:43:20 -0400 Subject: [PATCH] Fix camera movement when turning --- src/p_user.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 0763bca3..19accdba 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8221,7 +8221,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (timeover) { - const INT32 timeovercam = min(180, (player->kartstuff[k_timeovercam] - 2*TICRATE)*15); + const INT32 timeovercam = max(0, min(180, (player->kartstuff[k_timeovercam] - 2*TICRATE)*15)); camrotate += timeovercam; } else if (leveltime < introtime) // Whoooshy camera! @@ -8244,7 +8244,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (mo->eflags & MFE_VERTICALFLIP) camheight += thiscam->height; - if (leveltime < starttime || timeover == 2) + if (timeover) + angle = mo->angle + FixedAngle(camrotate*FRACUNIT); + else if (leveltime < starttime) angle = focusangle + FixedAngle(camrotate*FRACUNIT); else if (camstill || resetcalled || player->playerstate == PST_DEAD) angle = thiscam->angle; @@ -8534,15 +8536,15 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall viewpointx = mo->x + FixedMul(FINECOSINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist) + xpan; viewpointy = mo->y + FixedMul(FINESINE((angle>>ANGLETOFINESHIFT) & FINEMASK), dist) + ypan; - if (timeover == 2) + if (timeover) thiscam->angle = angle; else if (!camstill && !resetcalled && !paused && timeover != 1) thiscam->angle = R_PointToAngle2(thiscam->x, thiscam->y, viewpointx, viewpointy); if (timeover == 1) { - thiscam->momx = P_ReturnThrustX(NULL, thiscam->angle, 32<momy = P_ReturnThrustY(NULL, thiscam->angle, 32<momx = P_ReturnThrustX(NULL, mo->angle, 32<momy = P_ReturnThrustY(NULL, mo->angle, 32<momz = 0; } else if (player->exiting || timeover == 2)