summaryrefslogtreecommitdiffstats
path: root/src/core/re3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/re3.cpp')
-rw-r--r--src/core/re3.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 5d76d642..2046a7f9 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -24,6 +24,8 @@
#include "Hud.h"
#include "SceneEdit.h"
#include "Pad.h"
+#include "PlayerPed.h"
+#include "Radar.h"
#include <list>
@@ -164,6 +166,19 @@ FixCar(void)
((CAutomobile*)veh)->Fix();
}
+#ifdef MENU_MAP
+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));
+}
+#endif
+
static int engineStatus;
static void
SetEngineStatus(void)
@@ -335,6 +350,9 @@ DebugMenuPopulate(void)
DebugMenuAddVarBool8("Debug", "Draw hud", (int8*)&CHud::m_Wants_To_Draw_Hud, nil);
DebugMenuAddVarBool8("Debug", "Edit on", (int8*)&CSceneEdit::m_bEditOn, nil);
+#ifdef MENU_MAP
+ DebugMenuAddCmd("Debug", "Teleport to map waypoint", TeleportToWaypoint);
+#endif
DebugMenuAddVar("Debug", "Engine Status", &engineStatus, nil, 1, 0, 226, nil);
DebugMenuAddCmd("Debug", "Set Engine Status", SetEngineStatus);
DebugMenuAddCmd("Debug", "Fix Car", FixCar);