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.cpp54
1 files changed, 27 insertions, 27 deletions
diff --git a/src/core/re3.cpp b/src/core/re3.cpp
index 35b3cfa4..dc501075 100644
--- a/src/core/re3.cpp
+++ b/src/core/re3.cpp
@@ -14,7 +14,9 @@
#include "Streaming.h"
#include "PathFind.h"
#include "Boat.h"
+#include "Heli.h"
#include "Automobile.h"
+#include "Ped.h"
#include "debugmenu_public.h"
#include <vector>
@@ -138,6 +140,20 @@ SpawnCar(int id)
}
static void
+LetThemFollowYou(void) {
+ CPed* player = (CPed*) FindPlayerPed();
+ for (int i = 0; i < player->m_numNearPeds; i++) {
+
+ CPed* nearPed = player->m_nearPeds[i];
+ if (nearPed && !nearPed->IsPlayer()) {
+ nearPed->SetObjective(OBJECTIVE_FOLLOW_PED_IN_FORMATION, (void*)player);
+ nearPed->m_pedFormation = rand() & 7;
+ nearPed->bScriptObjectiveCompleted = false;
+ }
+ }
+}
+
+static void
FixCar(void)
{
CVehicle *veh = FindPlayerVehicle();
@@ -318,6 +334,12 @@ DebugMenuPopulate(void)
DebugMenuAddCmd("Debug", "Toggle Comedy Controls", ToggleComedy);
DebugMenuAddCmd("Debug", "Place Car on Road", PlaceOnRoad);
+ DebugMenuAddVarBool8("Debug", "Catalina Heli On", (int8*)&CHeli::CatalinaHeliOn, nil);
+ DebugMenuAddCmd("Debug", "Catalina Fly By", CHeli::StartCatalinaFlyBy);
+ DebugMenuAddCmd("Debug", "Catalina Take Off", CHeli::CatalinaTakeOff);
+ DebugMenuAddCmd("Debug", "Catalina Fly Away", CHeli::MakeCatalinaHeliFlyAway);
+ DebugMenuAddVarBool8("Debug", "Script Heli On", (int8*)0x95CD43, nil);
+
DebugMenuAddVarBool8("Debug", "Show Ped Road Groups", (int8*)&gbShowPedRoadGroups, nil);
DebugMenuAddVarBool8("Debug", "Show Car Road Groups", (int8*)&gbShowCarRoadGroups, nil);
DebugMenuAddVarBool8("Debug", "Show Collision Lines", (int8*)&gbShowCollisionLines, nil);
@@ -328,6 +350,11 @@ DebugMenuPopulate(void)
DebugMenuAddVarBool8("Debug", "Don't render Vehicles", (int8*)&gbDontRenderVehicles, nil);
DebugMenuAddVarBool8("Debug", "Don't render Objects", (int8*)&gbDontRenderObjects, nil);
+ DebugMenuAddCmd("Debug", "Make peds around you follow you", LetThemFollowYou);
+#ifndef FINAL
+ DebugMenuAddVarBool8("Debug", "Toggle unused fight feature", (int8*)&CPed::bUnusedFightThingOnPlayer, nil);
+#endif
+
DebugMenuAddCmd("Debug", "Start Credits", CCredits::Start);
DebugMenuAddCmd("Debug", "Stop Credits", CCredits::Stop);
@@ -347,29 +374,6 @@ delayedPatches10(int a, int b)
}
*/
-void __declspec(naked) HeadlightsFix()
-{
- static const float fMinusOne = -1.0f;
- _asm
- {
- fld [esp+708h-690h]
- fcomp fMinusOne
- fnstsw ax
- and ah, 5
- cmp ah, 1
- jnz HeadlightsFix_DontLimit
- fld fMinusOne
- fstp [esp+708h-690h]
-
-HeadlightsFix_DontLimit:
- fld [esp+708h-690h]
- fabs
- fld st
- push 0x5382F2
- retn
- }
-}
-
const int re3_buffsize = 1024;
static char re3_buff[re3_buffsize];
@@ -454,10 +458,6 @@ patch()
InjectHook(0x475E00, printf, PATCH_JUMP); // _Error
- // stolen from silentpatch (sorry)
- Patch<WORD>(0x5382BF, 0x0EEB);
- InjectHook(0x5382EC, HeadlightsFix, PATCH_JUMP);
-
// InterceptCall(&open_script_orig, open_script, 0x438869);
// InterceptCall(&RsEventHandler_orig, delayedPatches10, 0x58275E);