From 0c27e05e4c30ad712972cdc53d213eaba465a039 Mon Sep 17 00:00:00 2001 From: Ilya Shurumov Date: Fri, 30 Oct 2020 03:05:12 +0600 Subject: [PATCH] - event camera offsets - fix crash --- src_rebuild/GAME/C/CAMERA.C | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src_rebuild/GAME/C/CAMERA.C b/src_rebuild/GAME/C/CAMERA.C index 66b38541..41c2d284 100644 --- a/src_rebuild/GAME/C/CAMERA.C +++ b/src_rebuild/GAME/C/CAMERA.C @@ -73,6 +73,12 @@ void CalcCameraBasePos(_PLAYER* lp) basePos[1] = -event->position.vy; basePos[2] = event->position.vz; baseDir = event->rotation + 0x400U & 0xfff; + + EventCameraOffset(&boxDisp); // [A] + + basePos[0] += boxDisp.vx; + basePos[1] += boxDisp.vy - gCameraOffset.vy; + basePos[2] += boxDisp.vz; } else { @@ -945,7 +951,8 @@ void PlaceCameraInCar(_PLAYER *lp, int BumperCam) if (cp == NULL) { viewer_position.vz = 0; - viewer_position.vy = viewer_position.vy + 42 + lp->pPed->head_pos; + if(lp->pPed) + viewer_position.vy += lp->pPed->head_pos; } else if (cp->ap.carCos != NULL) // [A] prevent crash from happening {