- event camera offsets

- fix crash
This commit is contained in:
Ilya Shurumov 2020-10-30 03:05:12 +06:00
parent 657c9bb5d3
commit 0c27e05e4c

View File

@ -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
{