From 4c432c376e335b3f8fcd2fe2171dc534f16092e3 Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 16:22:12 +0800 Subject: [PATCH 1/2] Make camera use signpost's ground z coordinate instead of the player's z coordinate --- src/p_user.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 3c481e7e2..c17d708ba 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9889,10 +9889,20 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall pviewheight = FixedMul(41*player->height/48, mo->scale); - if (mo->eflags & MFE_VERTICALFLIP) - z = mo->z + mo->height - pviewheight - camheight + distz; + if (sign) + { + if (mo->eflags & MFE_VERTICALFLIP) + z = sign->ceilingz - pviewheight - camheight; + else + z = sign->floorz + pviewheight + camheight; + } else - z = mo->z + pviewheight + camheight + distz; + { + if (mo->eflags & MFE_VERTICALFLIP) + z = mo->z + mo->height - pviewheight - camheight; + else + z = mo->z + pviewheight + camheight; + } // move camera down to move under lower ceilings newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1)); From 27fcaf0f93f4a5cb3976f64537f446c9b7d8c85a Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 18 Nov 2019 16:26:15 +0800 Subject: [PATCH 2/2] Whoops, deleted a little too much by accident --- src/p_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index c17d708ba..bcb01dc02 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9899,9 +9899,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall else { if (mo->eflags & MFE_VERTICALFLIP) - z = mo->z + mo->height - pviewheight - camheight; + z = mo->z + mo->height - pviewheight - camheight + distz; else - z = mo->z + pviewheight + camheight; + z = mo->z + pviewheight + camheight + distz; } // move camera down to move under lower ceilings