Skip to content

Commit

Permalink
fix debug teleport
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick007J committed Aug 26, 2021
1 parent 2e02aed commit 399fb28
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/core/re3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
#include "CarCtrl.h"
#include "Population.h"
#include "IniFile.h"
#include "Zones.h"

#include "crossplatform.h"

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 399fb28

Please sign in to comment.