From a3e3527a3b8f260db285c76dc1044baab8a2f773 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 4 Aug 2019 00:31:00 +0200 Subject: implemented CHeli --- src/core/Stats.cpp | 4 +++- src/core/Stats.h | 2 ++ src/core/Wanted.h | 2 ++ src/core/World.cpp | 2 +- src/core/World.h | 4 ++-- src/core/re3.cpp | 34 +++++++--------------------------- 6 files changed, 17 insertions(+), 31 deletions(-) (limited to 'src/core') diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp index 01bbf82e..9d0e7df1 100644 --- a/src/core/Stats.cpp +++ b/src/core/Stats.cpp @@ -7,8 +7,10 @@ bool& CStats::CommercialPassed = *(bool*)0x8F4334; bool& CStats::IndustrialPassed = *(bool*)0x8E2A68; int32 &CStats::NumberKillFrenziesPassed = *(int32*)0x8E287C; int32 &CStats::PeopleKilledByOthers = *(int32*)0x8E2C50; +int32 &CStats::HelisDestroyed = *(int32*)0x8E2A64; +int32 *CStats::PedsKilledOfThisType = (int32*)0x880DBC; void CStats::AnotherKillFrenzyPassed() { ++NumberKillFrenziesPassed; -} \ No newline at end of file +} diff --git a/src/core/Stats.h b/src/core/Stats.h index c536465f..90db25e8 100644 --- a/src/core/Stats.h +++ b/src/core/Stats.h @@ -9,6 +9,8 @@ public: static bool& IndustrialPassed; static int32 &NumberKillFrenziesPassed; static int32 &PeopleKilledByOthers; + static int32 &HelisDestroyed; + static int32 *PedsKilledOfThisType; //[NUM_PEDTYPES] public: static void AnotherKillFrenzyPassed(); diff --git a/src/core/Wanted.h b/src/core/Wanted.h index 7cd89b7e..34a4b58d 100644 --- a/src/core/Wanted.h +++ b/src/core/Wanted.h @@ -77,6 +77,8 @@ public: void ReportCrimeNow(eCrimeType type, const CVector &coors, bool policeDoesntCare); void UpdateWantedLevel(); + bool IsIgnored(void) { return m_bIgnoredByCops || m_bIgnoredByEveryone; } + static int32 WorkOutPolicePresence(CVector posn, float radius); static void SetMaximumWantedLevel(int32 level); }; diff --git a/src/core/World.cpp b/src/core/World.cpp index 0440a951..c6eb831c 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -646,7 +646,7 @@ CWorld::FindObjectsInRange(CVector ¢re, float distance, bool ignoreZ, short } CEntity* -CWorld::TestSphereAgainstWorld(CVector centre, float distance, CEntity* entityToIgnore, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSomeObjects) +CWorld::TestSphereAgainstWorld(CVector centre, float distance, CEntity *entityToIgnore, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSomeObjects) { CEntity* foundE = nil; diff --git a/src/core/World.h b/src/core/World.h index e4f46589..6c52da5a 100644 --- a/src/core/World.h +++ b/src/core/World.h @@ -95,8 +95,8 @@ public: static bool GetIsLineOfSightSectorClear(CSector §or, const CColLine &line, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSeeThrough, bool ignoreSomeObjects = false); static bool GetIsLineOfSightSectorListClear(CPtrList &list, const CColLine &line, bool ignoreSeeThrough, bool ignoreSomeObjects = false); - static CEntity* TestSphereAgainstWorld(CVector, float, CEntity*, bool, bool, bool, bool, bool, bool); - static CEntity* TestSphereAgainstSectorList(CPtrList&, CVector, float, CEntity*, bool); + static CEntity *TestSphereAgainstWorld(CVector centre, float distance, CEntity *entityToIgnore, bool checkBuildings, bool checkVehicles, bool checkPeds, bool checkObjects, bool checkDummies, bool ignoreSomeObjects); + static CEntity *TestSphereAgainstSectorList(CPtrList&, CVector, float, CEntity*, bool); static void FindObjectsInRangeSectorList(CPtrList&, CVector&, float, bool, short*, short, CEntity**); static void FindObjectsInRange(CVector&, float, bool, short*, short, CEntity**, bool, bool, bool, bool, bool); static float FindGroundZForCoord(float x, float y); diff --git a/src/core/re3.cpp b/src/core/re3.cpp index 35b3cfa4..9681160f 100644 --- a/src/core/re3.cpp +++ b/src/core/re3.cpp @@ -14,6 +14,7 @@ #include "Streaming.h" #include "PathFind.h" #include "Boat.h" +#include "Heli.h" #include "Automobile.h" #include "debugmenu_public.h" @@ -318,6 +319,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); @@ -347,29 +354,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 +438,6 @@ patch() InjectHook(0x475E00, printf, PATCH_JUMP); // _Error - // stolen from silentpatch (sorry) - Patch(0x5382BF, 0x0EEB); - InjectHook(0x5382EC, HeadlightsFix, PATCH_JUMP); - // InterceptCall(&open_script_orig, open_script, 0x438869); // InterceptCall(&RsEventHandler_orig, delayedPatches10, 0x58275E); -- cgit v1.2.3