diff options
author | erorcun <erayorcunus@gmail.com> | 2020-04-19 16:56:39 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-19 16:56:39 +0300 |
commit | 0f07a323c9a0a97429c551808a38249a6b8ad1ff (patch) | |
tree | 563add6e54b45ac77ab863815a8750afed24bb1e /src/core/World.cpp | |
parent | f9ed50e17813d2a6708a6516e18041c7482a7462 (diff) | |
parent | bcc3a8b6c76ef5851af350ef4d839ef44d473f56 (diff) |
Merge pull request #474 from Nick007J/master
Bug fixes, mostly replay; added RegisterReference for player ped pointer
Diffstat (limited to 'src/core/World.cpp')
-rw-r--r-- | src/core/World.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/core/World.cpp b/src/core/World.cpp index eacb3404..7ef43593 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -1386,6 +1386,10 @@ FindPlayerEntity(void) CVector FindPlayerCoors(void) { +#ifdef FIX_BUGS + if (CReplay::IsPlayingBack()) + return TheCamera.GetPosition(); +#endif CPlayerPed *ped = FindPlayerPed(); if(ped->InVehicle()) return ped->m_pMyVehicle->GetPosition(); @@ -1396,6 +1400,11 @@ FindPlayerCoors(void) CVector & FindPlayerSpeed(void) { +#ifdef FIX_BUGS + static CVector vecTmpVector(0.0f, 0.0f, 0.0f); + if (CReplay::IsPlayingBack()) + return vecTmpVector; +#endif CPlayerPed *ped = FindPlayerPed(); if(ped->InVehicle()) return ped->m_pMyVehicle->m_vecMoveSpeed; @@ -1406,6 +1415,9 @@ FindPlayerSpeed(void) CVector & FindPlayerCentreOfWorld(int32 player) { +#ifdef FIX_BUGS + if(CReplay::IsPlayingBack()) return TheCamera.GetPosition(); +#endif if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition(); if(CWorld::Players[player].m_pRemoteVehicle) return CWorld::Players[player].m_pRemoteVehicle->GetPosition(); if(FindPlayerVehicle()) return FindPlayerVehicle()->GetPosition(); @@ -1415,6 +1427,9 @@ FindPlayerCentreOfWorld(int32 player) CVector & FindPlayerCentreOfWorld_NoSniperShift(void) { +#ifdef FIX_BUGS + if (CReplay::IsPlayingBack()) return TheCamera.GetPosition(); +#endif if(CCarCtrl::bCarsGeneratedAroundCamera) return TheCamera.GetPosition(); if(CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle) return CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle->GetPosition(); |