fix debug teleport

This commit is contained in:
Nikolay Korolev 2021-08-26 21:50:19 +03:00
parent 2e02aed5d5
commit 399fb28f77

View file

@ -44,6 +44,7 @@
#include "CarCtrl.h" #include "CarCtrl.h"
#include "Population.h" #include "Population.h"
#include "IniFile.h" #include "IniFile.h"
#include "Zones.h"
#include "crossplatform.h" #include "crossplatform.h"
@ -746,12 +747,15 @@ FixCar(void)
static void static void
TeleportToWaypoint(void) TeleportToWaypoint(void)
{ {
if (FindPlayerVehicle()) { if (CRadar::TargetMarkerId == -1)
if (CRadar::TargetMarkerId != -1) return;
FindPlayerVehicle()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, FindPlayerVehicle()->GetColModel()->boundingSphere.center.z)); CEntity* pEntityToTeleport = FindPlayerEntity();
} else CVector vNewPos = CRadar::TargetMarkerPos;
if(CRadar::TargetMarkerId != -1) CGame::currLevel = CTheZones::GetLevelFromPosition(&vNewPos);
FindPlayerPed()->Teleport(CRadar::TargetMarkerPos + CVector(0.0f, 0.0f, FEET_OFFSET)); CCollision::SortOutCollisionAfterLoad();
CStreaming::LoadScene(vNewPos);
vNewPos.z = CWorld::FindGroundZForCoord(vNewPos.x, vNewPos.y) + pEntityToTeleport->GetDistanceFromCentreOfMassToBaseOfModel();
pEntityToTeleport->Teleport(vNewPos);
} }
#endif #endif