From 025aa2a0977cd82d478a1971b243eeb269d84a51 Mon Sep 17 00:00:00 2001 From: Jaime Ita Passos Date: Thu, 8 Apr 2021 21:47:36 -0300 Subject: [PATCH] Fixes --- src/p_mobj.c | 9 +++++++-- src/p_user.c | 19 ++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 49db6daee..cda5dcec9 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3697,11 +3697,16 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled // clip movement if (thiscam->z <= thiscam->floorz) // hit the floor { - fixed_t cam_height = cv_cam_height.value; + fixed_t cam_height; thiscam->z = thiscam->floorz; - if (player == &players[secondarydisplayplayer]) + if (thiscam->scanner.height) + cam_height = (*thiscam->scanner.height); + else if (player == &players[secondarydisplayplayer]) cam_height = cv_cam2_height.value; + else + cam_height = cv_cam_height.value; + if (thiscam->z > player->mo->z + player->mo->height + FixedMul(cam_height*FRACUNIT + 16*FRACUNIT, player->mo->scale)) { if (!resetcalled) diff --git a/src/p_user.c b/src/p_user.c index 4973b9bc1..55439daa3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9831,7 +9831,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall focusangle = localangle2; else focusangle = mo->angle; - if (thiscam == &camera) + if (thiscam->scanner.rotate) + camrotate = (*thiscam->scanner.rotate); + else if (thiscam == &camera) camrotate = cv_cam_rotate.value; else if (thiscam == &camera2) camrotate = cv_cam2_rotate.value; @@ -9886,8 +9888,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = (!stricmp(cv_cam_still.defaultvalue, "off")) ? false : true; camorbit = (!stricmp(cv_cam_orbit.defaultvalue, "off")) ? false : true; camrotate = atoi(cv_cam_rotate.defaultvalue); - camdist = FixedMul((INT32)(atof(cv_cam_dist.defaultvalue) * FRACUNIT), mo->scale); - camheight = FixedMul((INT32)(atof(cv_cam_height.defaultvalue) * FRACUNIT), mo->scale); + camdist = (INT32)(atof(cv_cam_dist.defaultvalue) * FRACUNIT); + camheight = (INT32)(atof(cv_cam_height.defaultvalue) * FRACUNIT); } else if (thiscam == &camera) { @@ -9895,8 +9897,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam_still.value; camorbit = cv_cam_orbit.value; camrotate = cv_cam_rotate.value; - camdist = FixedMul(cv_cam_dist.value, mo->scale); - camheight = FixedMul(cv_cam_height.value, mo->scale); + camdist = cv_cam_dist.value; + camheight = cv_cam_height.value; } else // Camera 2 { @@ -9904,8 +9906,8 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall camstill = cv_cam2_still.value; camorbit = cv_cam2_orbit.value; camrotate = cv_cam2_rotate.value; - camdist = FixedMul(cv_cam2_dist.value, mo->scale); - camheight = FixedMul(cv_cam2_height.value, mo->scale); + camdist = cv_cam2_dist.value; + camheight = cv_cam2_height.value; } if (thiscam->scanner.height) @@ -9915,6 +9917,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (thiscam->scanner.rotate) camrotate = (*thiscam->scanner.rotate); + camdist = FixedMul(camdist, mo->scale); + camheight = FixedMul(camheight, mo->scale); + if (!(twodlevel || (mo->flags2 & MF2_TWOD)) && !(player->powers[pw_carry] == CR_NIGHTSMODE)) camheight = FixedMul(camheight, player->camerascale);