fixed debug teleport

This commit is contained in:
Nikolay Korolev 2021-08-26 21:14:26 +03:00
parent b7db2a12d4
commit 915888d275
2 changed files with 5 additions and 3 deletions

View file

@ -1504,7 +1504,7 @@ CRadar::ToggleTargetMarker(float x, float y)
ms_RadarTrace[nextBlip].m_bDim = 0;
ms_RadarTrace[nextBlip].m_bInUse = 1;
ms_RadarTrace[nextBlip].m_Radius = 1.0f;
CVector pos(x, y, 0.0f/*CWorld::FindGroundZForCoord(x,y)*/);
CVector pos(x, y, 0.0f);
TargetMarkerPos = pos;
ms_RadarTrace[nextBlip].m_vec2DPos = pos;
ms_RadarTrace[nextBlip].m_vecPos = pos;

View file

@ -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