Make camera use signpost's ground z coordinate instead of the player's z coordinate

This commit is contained in:
lachwright 2019-11-18 16:22:12 +08:00
parent 144502729a
commit 4c432c376e
1 changed files with 13 additions and 3 deletions

View File

@ -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));