summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2020-04-16 21:21:43 +0200
committerGitHub <noreply@github.com>2020-04-16 21:21:43 +0200
commit435a9ca7f272f0238440b939bc57c78d2385dd1a (patch)
tree78ca1babbac01fff758c20ed9ae4bc3ffb210095 /src/core
parentMore refs removed (diff)
parentSome refs removed, little fixes and teleport (diff)
downloadre3-435a9ca7f272f0238440b939bc57c78d2385dd1a.tar
re3-435a9ca7f272f0238440b939bc57c78d2385dd1a.tar.gz
re3-435a9ca7f272f0238440b939bc57c78d2385dd1a.tar.bz2
re3-435a9ca7f272f0238440b939bc57c78d2385dd1a.tar.lz
re3-435a9ca7f272f0238440b939bc57c78d2385dd1a.tar.xz
re3-435a9ca7f272f0238440b939bc57c78d2385dd1a.tar.zst
re3-435a9ca7f272f0238440b939bc57c78d2385dd1a.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/MenuScreens.h2
-rw-r--r--src/core/Radar.cpp8
-rw-r--r--src/core/Radar.h5
-rw-r--r--src/core/re3.cpp18
4 files changed, 27 insertions, 6 deletions
diff --git a/src/core/MenuScreens.h b/src/core/MenuScreens.h
index e1b1bac6..8692d4dc 100644
--- a/src/core/MenuScreens.h
+++ b/src/core/MenuScreens.h
@@ -32,7 +32,7 @@ const CMenuScreen aScreens[] = {
MENUACTION_CHANGEMENU, "FEDS_TB", SAVESLOT_NONE, MENUPAGE_NONE,
},
- // MENU_CONTROLLER_SETTINGS = 4
+ // MENUPAGE_CONTROLLER_SETTINGS = 4
{ "FET_CON", 1, MENUPAGE_OPTIONS, MENUPAGE_OPTIONS, 0, 0,
MENUACTION_CTRLCONFIG, "FEC_CCF", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
MENUACTION_CTRLDISPLAY, "FEC_CDP", SAVESLOT_NONE, MENUPAGE_CONTROLLER_SETTINGS,
diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp
index 154e7e9a..ed24814d 100644
--- a/src/core/Radar.cpp
+++ b/src/core/Radar.cpp
@@ -16,9 +16,9 @@
#include "Streaming.h"
#include "SpecialFX.h"
-float &CRadar::m_radarRange = *(float*)0x8E281C;
-sRadarTrace (&CRadar::ms_RadarTrace)[NUMRADARBLIPS] = *(sRadarTrace(*)[NUMRADARBLIPS]) * (uintptr*)0x6ED5E0;
-CVector2D &vec2DRadarOrigin = *(CVector2D*)0x6299B8;
+float CRadar::m_radarRange;
+sRadarTrace CRadar::ms_RadarTrace[NUMRADARBLIPS];
+CVector2D vec2DRadarOrigin;
int32 gRadarTxdIds[64];// = (int*)0x6299C0;
CSprite2d CRadar::AsukaSprite;// = *(CSprite2d*)0x8F1A40;
@@ -81,6 +81,7 @@ CRGBA CRadar::ArrowBlipColour2;
uint16 CRadar::MapLegendCounter;
uint16 CRadar::MapLegendList[NUM_MAP_LEGENDS];
int CRadar::TargetMarkerId = -1;
+CVector CRadar::TargetMarkerPos;
#endif
// taken from VC
@@ -1442,6 +1443,7 @@ CRadar::ToggleTargetMarker(float x, float y)
ms_RadarTrace[nextBlip].m_bInUse = 1;
ms_RadarTrace[nextBlip].m_Radius = 1.0f;
CVector pos(x, y, CWorld::FindGroundZForCoord(x,y));
+ TargetMarkerPos = pos;
ms_RadarTrace[nextBlip].m_vec2DPos = pos;
ms_RadarTrace[nextBlip].m_vecPos = pos;
ms_RadarTrace[nextBlip].m_nEntityHandle = 0;
diff --git a/src/core/Radar.h b/src/core/Radar.h
index 27f3a6f0..e39a17f0 100644
--- a/src/core/Radar.h
+++ b/src/core/Radar.h
@@ -82,8 +82,8 @@ static_assert(sizeof(sRadarTrace) == 0x30, "sRadarTrace: error");
class CRadar
{
public:
- static float &m_radarRange;
- static sRadarTrace (&ms_RadarTrace)[NUMRADARBLIPS];
+ static float m_radarRange;
+ static sRadarTrace ms_RadarTrace[NUMRADARBLIPS];
static CSprite2d AsukaSprite;
static CSprite2d BombSprite;
static CSprite2d CatSprite;
@@ -114,6 +114,7 @@ public:
static uint16 MapLegendList[NUM_MAP_LEGENDS];
static uint16 MapLegendCounter;
static int TargetMarkerId;
+ static CVector TargetMarkerPos;
static void InitFrontEndMap();
static void DrawYouAreHereSprite(float, float);
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 5d76d642..ecf02f39 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)
@@ -359,6 +374,9 @@ DebugMenuPopulate(void)
DebugMenuAddVarBool8("Debug", "Don't render Peds", (int8*)&gbDontRenderPeds, nil);
DebugMenuAddVarBool8("Debug", "Don't render Vehicles", (int8*)&gbDontRenderVehicles, nil);
DebugMenuAddVarBool8("Debug", "Don't render Objects", (int8*)&gbDontRenderObjects, nil);
+#ifdef MENU_MAP
+ DebugMenuAddCmd("Debug", "Teleport to map waypoint", TeleportToWaypoint);
+#endif
#ifdef TOGGLEABLE_BETA_FEATURES
DebugMenuAddVarBool8("Debug", "Toggle banned particles", (int8*)&CParticle::bEnableBannedParticles, nil);
DebugMenuAddVarBool8("Debug", "Toggle popping heads on headshot", (int8*)&CPed::bPopHeadsOnHeadshot, nil);