From 915888d2752cd78a6a64735d3856ac0c4d7153d2 Mon Sep 17 00:00:00 2001 From: Nikolay Korolev Date: Thu, 26 Aug 2021 21:14:26 +0300 Subject: fixed debug teleport --- src/core/re3.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/re3.cpp') diff --git a/src/core/re3.cpp b/src/core/re3.cpp index d3b1f266..672cca98 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -775,12 +775,14 @@ FixCar(void) static void TeleportToWaypoint(void) { + CStreaming::LoadScene(CRadar::TargetMarkerPos); + CStreaming::LoadSceneCollision(CRadar::TargetMarkerPos); if (FindPlayerVehicle()) { if (CRadar::TargetMarkerId != -1) - FindPlayerVehicle()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, FindPlayerVehicle()->GetColModel()->boundingSphere.center.z)); + FindPlayerVehicle()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, CWorld::FindGroundZForCoord(CRadar::TargetMarkerPos.x, CRadar::TargetMarkerPos.y) + FindPlayerVehicle()->GetColModel()->boundingSphere.radius)); } else if(CRadar::TargetMarkerId != -1) - FindPlayerPed()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, FEET_OFFSET)); + FindPlayerPed()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, CWorld::FindGroundZForCoord(CRadar::TargetMarkerPos.x, CRadar::TargetMarkerPos.y) + FEET_OFFSET)); } #endif -- cgit v1.2.3