diff options
author | Sergeanur <s.anureev@yandex.ua> | 2021-08-29 08:58:54 +0300 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2021-08-29 08:58:54 +0300 |
commit | 2be8fcfa64a9925206ed2356c2934c7559873a6a (patch) | |
tree | 9937e069805afb805c13c81877714465ad34b5fd /src/core/re3.cpp | |
parent | 2a69f34f93b1188c479fe385780b0ca768f65d35 (diff) | |
parent | 8ef1e29a5ca389f56e942b25e7ad8062beb56cac (diff) |
Merge remote-tracking branch 'origin/miami' into lcs
# Conflicts:
# src/audio/AudioManager.cpp
# src/core/Radar.cpp
Diffstat (limited to 'src/core/re3.cpp')
-rw-r--r-- | src/core/re3.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp index ca1915b0..4c2b9388 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -47,6 +47,7 @@ #include "CarCtrl.h" #include "Population.h" #include "IniFile.h" +#include "Zones.h" #include "crossplatform.h" @@ -771,12 +772,14 @@ FixCar(void) static void TeleportToWaypoint(void) { - if (FindPlayerVehicle()) { - if (CRadar::TargetMarkerId != -1) - FindPlayerVehicle()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, FindPlayerVehicle()->GetColModel()->boundingSphere.center.z)); - } else - if(CRadar::TargetMarkerId != -1) - FindPlayerPed()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, FEET_OFFSET)); + if (CRadar::TargetMarkerId == -1) + return; + CEntity* pEntityToTeleport = FindPlayerEntity(); + CVector vNewPos = CRadar::TargetMarkerPos; + CStreaming::LoadScene(vNewPos); + CStreaming::LoadSceneCollision(vNewPos); + vNewPos.z = CWorld::FindGroundZForCoord(vNewPos.x, vNewPos.y) + pEntityToTeleport->GetDistanceFromCentreOfMassToBaseOfModel(); + pEntityToTeleport->Teleport(vNewPos); } #endif |