summaryrefslogtreecommitdiffstats
path: root/src/core/re3.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-08-26 20:50:19 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2021-08-26 20:50:19 +0200
commit399fb28f777f56efbafb23b6f3ef9c6383529e83 (patch)
tree0f4e2258b7cdbe045baae540bbaa8c8e9cd1e288 /src/core/re3.cpp
parentFix acceleration sound on exiting the vehicle (diff)
downloadre3-399fb28f777f56efbafb23b6f3ef9c6383529e83.tar
re3-399fb28f777f56efbafb23b6f3ef9c6383529e83.tar.gz
re3-399fb28f777f56efbafb23b6f3ef9c6383529e83.tar.bz2
re3-399fb28f777f56efbafb23b6f3ef9c6383529e83.tar.lz
re3-399fb28f777f56efbafb23b6f3ef9c6383529e83.tar.xz
re3-399fb28f777f56efbafb23b6f3ef9c6383529e83.tar.zst
re3-399fb28f777f56efbafb23b6f3ef9c6383529e83.zip
Diffstat (limited to 'src/core/re3.cpp')
-rw-r--r--src/core/re3.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 980ec845..a721c238 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -44,6 +44,7 @@
#include "CarCtrl.h"
#include "Population.h"
#include "IniFile.h"
+#include "Zones.h"
#include "crossplatform.h"
@@ -746,12 +747,15 @@ 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;
+ CGame::currLevel = CTheZones::GetLevelFromPosition(&vNewPos);
+ CCollision::SortOutCollisionAfterLoad();
+ CStreaming::LoadScene(vNewPos);
+ vNewPos.z = CWorld::FindGroundZForCoord(vNewPos.x, vNewPos.y) + pEntityToTeleport->GetDistanceFromCentreOfMassToBaseOfModel();
+ pEntityToTeleport->Teleport(vNewPos);
}
#endif