- fix crash when switching camera to event in film director

This commit is contained in:
InspirationByte 2022-03-12 10:11:36 +03:00
parent 238a121ec7
commit d951422e95

View File

@ -592,9 +592,9 @@ void PlaceCameraInCar(PLAYER *lp, int BumperCam)
// [A] handle REDRIVER2 dedicated look back button // [A] handle REDRIVER2 dedicated look back button
if ((paddCamera & CAMERA_PAD_LOOK_BACK) == CAMERA_PAD_LOOK_BACK || (paddCamera & CAMERA_PAD_LOOK_BACK_DED)) if ((paddCamera & CAMERA_PAD_LOOK_BACK) == CAMERA_PAD_LOOK_BACK || (paddCamera & CAMERA_PAD_LOOK_BACK_DED))
camera_angle.vy = 2048 - baseDir & 0xfff; camera_angle.vy = 2048 - baseDir & 4095;
else else
camera_angle.vy = (lp->headPos >> 16) - baseDir & 0xfff; camera_angle.vy = (lp->headPos >> 16) - baseDir & 4095;
if (cp) if (cp)
{ {
@ -632,13 +632,18 @@ void PlaceCameraInCar(PLAYER *lp, int BumperCam)
} }
else else
{ {
LPPEDESTRIAN pPlayerPed;
pPlayerPed = lp->pPed;
camera_angle.vx = -tannerLookAngle.vx; camera_angle.vx = -tannerLookAngle.vx;
// pedestrian camera is much simpler
BuildWorldMatrix(); BuildWorldMatrix();
viewer_position.vy += lp->pPed->head_pos - 25; if (pPlayerPed)
//viewer_position.vz += 45; {
// apply pedestrian bobbing
viewer_position.vy += pPlayerPed->head_pos - 25;
}
angle = -baseDir; angle = -baseDir;