Final lack of smoothness in camera cutaway killed: A one-frame window where focus angle/pitch was incorrect due to not having thunk yet

This commit is contained in:
toaster 2023-05-30 01:12:59 +01:00
parent f24df4f38d
commit 36d81d7996
2 changed files with 23 additions and 0 deletions

View file

@ -9463,6 +9463,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
}
// If target is valid, then we'll focus on it.
// See also linedef type 422
if (mobj->target != NULL && P_MobjWasRemoved(mobj->target) == false)
{
mobj->angle = R_PointToAngle2(

View file

@ -3135,6 +3135,28 @@ boolean P_ProcessSpecial(activator_t *activator, INT16 special, INT32 *args, cha
break;
}
}
// If target is valid, then we'll focus on it.
// See also MT_ALTVIEWMAN mobjthinker
if (newViewMobj->target != NULL && P_MobjWasRemoved(newViewMobj->target) == false)
{
newViewMobj->angle = R_PointToAngle2(
newViewMobj->x,
newViewMobj->y,
newViewMobj->target->x,
newViewMobj->target->y
);
newViewMobj->pitch = R_PointToAngle2(
0,
newViewMobj->z,
R_PointToDist2(
newViewMobj->x, newViewMobj->y,
newViewMobj->target->x, newViewMobj->target->y
),
newViewMobj->target->z + (newViewMobj->target->height >> 1)
);
}
}
else
{