diff options
author | erorcun <erayorcunus@gmail.com> | 2020-01-07 15:08:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-07 15:08:51 +0100 |
commit | 18de44e038c904e4de21f42a12afa188146587d1 (patch) | |
tree | 6efdd7adc1648fd63414227dcd9ac13d54ab31b5 /src/core | |
parent | Use CGeneral::faststricmp in CPed::ServiceTalking (diff) | |
parent | fixes (diff) | |
download | re3-18de44e038c904e4de21f42a12afa188146587d1.tar re3-18de44e038c904e4de21f42a12afa188146587d1.tar.gz re3-18de44e038c904e4de21f42a12afa188146587d1.tar.bz2 re3-18de44e038c904e4de21f42a12afa188146587d1.tar.lz re3-18de44e038c904e4de21f42a12afa188146587d1.tar.xz re3-18de44e038c904e4de21f42a12afa188146587d1.tar.zst re3-18de44e038c904e4de21f42a12afa188146587d1.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/Camera.cpp | 10 | ||||
-rw-r--r-- | src/core/Camera.h | 3 | ||||
-rw-r--r-- | src/core/Explosion.cpp | 1 | ||||
-rw-r--r-- | src/core/Explosion.h | 1 | ||||
-rw-r--r-- | src/core/Fire.cpp | 17 | ||||
-rw-r--r-- | src/core/Fire.h | 9 | ||||
-rw-r--r-- | src/core/Stats.cpp | 16 | ||||
-rw-r--r-- | src/core/Stats.h | 17 | ||||
-rw-r--r-- | src/core/World.cpp | 8 | ||||
-rw-r--r-- | src/core/World.h | 6 | ||||
-rw-r--r-- | src/core/ZoneCull.cpp | 6 | ||||
-rw-r--r-- | src/core/config.h | 1 |
12 files changed, 87 insertions, 8 deletions
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp index 3ab7d742..1aee4edb 100644 --- a/src/core/Camera.cpp +++ b/src/core/Camera.cpp @@ -33,6 +33,8 @@ WRAPPER void CCamera::LoadPathSplines(int file) { EAXJMP(0x46D1D0); } WRAPPER uint32 CCamera::GetCutSceneFinishTime(void) { EAXJMP(0x46B920); } WRAPPER void CCamera::FinishCutscene(void) { EAXJMP(0x46B560); } WRAPPER void CCamera::RestoreWithJumpCut(void) { EAXJMP(0x46FAE0); }; +WRAPPER void CCamera::SetZoomValueFollowPedScript(int16) { EAXJMP(0x46FF30); } +WRAPPER void CCamera::SetZoomValueCamStringScript(int16) { EAXJMP(0x46FF90); } bool CCamera::GetFading() @@ -1357,6 +1359,14 @@ void CCamera::SetCameraDirectlyInFrontForFollowPed_CamOnAString() m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
} +void CCamera::SetCameraDirectlyBehindForFollowPed_CamOnAString()
+{
+ m_bCamDirectlyBehind = true;
+ CPlayerPed *player = FindPlayerPed();
+ if (player)
+ m_PedOrientForBehindOrInFront = CGeneral::GetATanOfXY(player->GetForward().x, player->GetForward().y);
+} + void CCamera::SetWideScreenOn(void) { diff --git a/src/core/Camera.h b/src/core/Camera.h index 46c25436..81eaa84f 100644 --- a/src/core/Camera.h +++ b/src/core/Camera.h @@ -491,6 +491,9 @@ int m_iModeObbeCamIsInForCar; void TakeControlWithSpline(short); void RestoreWithJumpCut(void); void SetCameraDirectlyInFrontForFollowPed_CamOnAString(void); + void SetCameraDirectlyBehindForFollowPed_CamOnAString(void); + void SetZoomValueFollowPedScript(int16); + void SetZoomValueCamStringScript(int16); void dtor(void) { this->CCamera::~CCamera(); } }; diff --git a/src/core/Explosion.cpp b/src/core/Explosion.cpp index 30809dc9..7a8878f6 100644 --- a/src/core/Explosion.cpp +++ b/src/core/Explosion.cpp @@ -4,6 +4,7 @@ WRAPPER void CExplosion::AddExplosion(CEntity *explodingEntity, CEntity *culprit, eExplosionType type, const CVector &pos, uint32) { EAXJMP(0x5591C0); } WRAPPER void CExplosion::RemoveAllExplosionsInArea(CVector, float) { EAXJMP(0x55AD40); } +WRAPPER bool CExplosion::TestForExplosionInArea(eExplosionType, float, float, float, float, float, float) { EAXJMP(0x55AC80); } WRAPPER int8 CExplosion::GetExplosionActiveCounter(uint8 id) diff --git a/src/core/Explosion.h b/src/core/Explosion.h index 0768bbe4..e85f7892 100644 --- a/src/core/Explosion.h +++ b/src/core/Explosion.h @@ -28,4 +28,5 @@ public: static uint8 GetExplosionType(uint8 id); static void ResetExplosionActiveCounter(uint8 id); static void RemoveAllExplosionsInArea(CVector, float); + static bool TestForExplosionInArea(eExplosionType, float, float, float, float, float, float); }; diff --git a/src/core/Fire.cpp b/src/core/Fire.cpp index 7657d8e9..f83ad2c8 100644 --- a/src/core/Fire.cpp +++ b/src/core/Fire.cpp @@ -5,10 +5,14 @@ CFireManager &gFireManager = *(CFireManager*)0x8F31D0; WRAPPER void CFire::Extinguish(void) { EAXJMP(0x479D40); } -WRAPPER void CFireManager::StartFire(CEntity* entityOnFire, CEntity* culprit, float, uint32) { EAXJMP(0x479590); } WRAPPER void CFireManager::Update(void) { EAXJMP(0x479310); } WRAPPER CFire* CFireManager::FindFurthestFire_NeverMindFireMen(CVector coors, float, float) { EAXJMP(0x479430); } +uint32 CFireManager::GetTotalActiveFires() const +{ + return m_nTotalFires; +} + CFire* CFireManager::FindNearestFire(CVector vecPos, float* pDistance) { for (int i = 0; i < MAX_FIREMEN_ATTENDING; i++) { @@ -45,7 +49,16 @@ CFireManager::ExtinguishPoint(CVector point, float range) } } +WRAPPER void CFireManager::StartFire(CEntity *entityOnFire, CEntity *culprit, float, uint32) { EAXJMP(0x479590); } +WRAPPER void CFireManager::StartFire(CVector, float, uint8) { EAXJMP(0x479500); } +WRAPPER int32 CFireManager::StartScriptFire(const CVector& pos, CEntity* culprit, float, uint8) { EAXJMP(0x479E60); } +WRAPPER bool CFireManager::IsScriptFireExtinguish(int16) { EAXJMP(0x479FC0); } +WRAPPER void CFireManager::RemoveScriptFire(int16) { EAXJMP(0x479FE0); } +WRAPPER void CFireManager::RemoveAllScriptFires(void) { EAXJMP(0x47A000); } +WRAPPER void CFireManager::SetScriptFireAudio(int16, bool) { EAXJMP(0x47A040); } + STARTPATCHES InjectHook(0x479DB0, &CFireManager::ExtinguishPoint, PATCH_JUMP); InjectHook(0x479340, &CFireManager::FindNearestFire, PATCH_JUMP); -ENDPATCHES
\ No newline at end of file +ENDPATCHES + diff --git a/src/core/Fire.h b/src/core/Fire.h index e0ad7cdf..9d72179e 100644 --- a/src/core/Fire.h +++ b/src/core/Fire.h @@ -31,11 +31,16 @@ class CFireManager CFire m_aFires[NUM_FIRES]; public: void StartFire(CEntity *entityOnFire, CEntity *culprit, float, uint32); + void StartFire(CVector, float, uint8); void Update(void); CFire *FindFurthestFire_NeverMindFireMen(CVector coors, float, float); CFire *FindNearestFire(CVector, float*); + uint32 GetTotalActiveFires() const; void ExtinguishPoint(CVector, float); - - uint32 GetTotalActiveFires() const { return m_nTotalFires; } + int32 StartScriptFire(const CVector& pos, CEntity* culprit, float, uint8); + bool IsScriptFireExtinguish(int16); + void RemoveScriptFire(int16); + void RemoveAllScriptFires(void); + void SetScriptFireAudio(int16, bool); }; extern CFireManager &gFireManager; diff --git a/src/core/Stats.cpp b/src/core/Stats.cpp index aa3f21a9..fd6ba602 100644 --- a/src/core/Stats.cpp +++ b/src/core/Stats.cpp @@ -5,6 +5,7 @@ int32 &CStats::DaysPassed = *(int32*)0x8F2BB8; int32 &CStats::HeadsPopped = *(int32*)0x8F647C; bool& CStats::CommercialPassed = *(bool*)0x8F4334; bool& CStats::IndustrialPassed = *(bool*)0x8E2A68; +bool& CStats::SuburbanPassed = *(bool*)0x8F2740; int32 &CStats::NumberKillFrenziesPassed = *(int32*)0x8E287C; int32 &CStats::PeopleKilledByOthers = *(int32*)0x8E2C50; int32 &CStats::HelisDestroyed = *(int32*)0x8E2A64; @@ -14,6 +15,21 @@ int32 &CStats::TimesArrested = *(int32*)0x8E2BEC; int32 &CStats::KillsSinceLastCheckpoint = *(int32*)0x8F2C8C; int32& CStats::DistanceTravelledInVehicle = *(int32*)0x940574; int32& CStats::DistanceTravelledOnFoot = *(int32*)0x941518; +int32 &CStats::ProgressMade = *(int32*)0x8F6224; +int32 &CStats::TotalProgressInGame = *(int32*)0x885B2C; +float &CStats::MaximumJumpDistance = *(float*)0x8F2BDC; +float &CStats::MaximumJumpHeight = *(float*)0x940564; +int32 &CStats::MaximumJumpFlips = *(int32*)0x8F2524; +int32 &CStats::MaximumJumpSpins = *(int32*)0x8F29B0; +int32 &CStats::BestStuntJump = *(int32*)0x885B50; +int32 &CStats::NumberOfUniqueJumpsFound = *(int32*)0x885B74; +int32 &CStats::TotalNumberOfUniqueJumps = *(int32*)0x8E2DC0; +int32 &CStats::PassengersDroppedOffWithTaxi = *(int32*)0x940724; +int32 &CStats::MoneyMadeWithTaxi = *(int32*)0x941544; +int32 &CStats::MissionsGiven = *(int32*)0x9430E8; +int32 &CStats::MissionsPassed = *(int32*)0x940768; +char(&CStats::LastMissionPassedName)[8] = *(char(*)[8])*(uintptr*)0x70D828; +int32 &CStats::TotalLegitimateKills = *(int32*)0x8F6004; void CStats::AnotherKillFrenzyPassed() { diff --git a/src/core/Stats.h b/src/core/Stats.h index 13f97218..8feb3c13 100644 --- a/src/core/Stats.h +++ b/src/core/Stats.h @@ -7,6 +7,7 @@ public: static int32 &HeadsPopped; static bool& CommercialPassed; static bool& IndustrialPassed; + static bool& SuburbanPassed; static int32 &NumberKillFrenziesPassed; static int32 &PeopleKilledByOthers; static int32 &HelisDestroyed; @@ -16,8 +17,24 @@ public: static int32 &KillsSinceLastCheckpoint; static int32 &DistanceTravelledInVehicle; static int32 &DistanceTravelledOnFoot; + static int32 &ProgressMade; + static int32 &TotalProgressInGame; + static float &MaximumJumpDistance; + static float &MaximumJumpHeight; + static int32 &MaximumJumpFlips; + static int32 &MaximumJumpSpins; + static int32 &BestStuntJump; + static int32 &NumberOfUniqueJumpsFound; + static int32 &TotalNumberOfUniqueJumps; + static int32 &PassengersDroppedOffWithTaxi; + static int32 &MoneyMadeWithTaxi; + static int32 &MissionsGiven; + static int32 &MissionsPassed; + static char (&LastMissionPassedName)[8]; + static int32 &TotalLegitimateKills; public: static void AnotherKillFrenzyPassed(); static void CheckPointReachedUnsuccessfully() { KillsSinceLastCheckpoint = 0; }; + static void CheckPointReachedSuccessfully() { TotalLegitimateKills += KillsSinceLastCheckpoint; KillsSinceLastCheckpoint = 0; }; };
\ No newline at end of file diff --git a/src/core/World.cpp b/src/core/World.cpp index dac64970..0b389e42 100644 --- a/src/core/World.cpp +++ b/src/core/World.cpp @@ -44,6 +44,10 @@ WRAPPER void CWorld::RemoveStaticObjects() { EAXJMP(0x4B4D50); } WRAPPER void CWorld::RemoveReferencesToDeletedObject(CEntity*) { EAXJMP(0x4B3BF0); } WRAPPER void CWorld::FindObjectsKindaColliding(const CVector &, float, bool, int16*, int16, CEntity **, bool, bool, bool, bool, bool){ EAXJMP(0x4B2A30); } WRAPPER void CWorld::ClearExcitingStuffFromArea(const CVector &pos, float radius, uint8) { EAXJMP(0x4B4E70) }; +WRAPPER void CWorld::FindObjectsIntersectingCube(const CVector &, const CVector &, int16*, int16, CEntity **, bool, bool, bool, bool, bool) { EAXJMP(0x4B2E70); } +WRAPPER void CWorld::FindObjectsIntersectingAngledCollisionBox(const CColBox &, const CMatrix &, const CVector &, float, float, float, float, int16*, int16, CEntity **, bool, bool, bool, bool, bool) { EAXJMP(0x4B3280); } +WRAPPER void CWorld::FindObjectsOfTypeInRange(uint32, CVector&, float, bool, short*, short, CEntity**, bool, bool, bool, bool, bool) { EAXJMP(0x4B2600); } +WRAPPER void CWorld::FindObjectsOfTypeInRangeSectorList(uint32, CPtrList&, CVector&, float, bool, short*, short, CEntity**) { EAXJMP(0x4B2960); } void CWorld::Initialise() @@ -960,7 +964,7 @@ CWorld::RemoveFallenPeds(void) for(int poolIndex = poolSize-1; poolIndex >= 0; poolIndex--) { CPed *ped = CPools::GetPedPool()->GetSlot(poolIndex); if (ped) { - if (ped->GetPosition().z < -100.0f) { + if (ped->GetPosition().z < MAP_Z_LOW_LIMIT) { if (ped->CharCreatedBy != RANDOM_CHAR || ped->IsPlayer()) { int closestNode = ThePaths.FindNodeClosestToCoors(ped->GetPosition(), PATH_PED, 999999.9f, false, false); CVector newPos = ThePaths.m_pathNodes[closestNode].pos; @@ -982,7 +986,7 @@ CWorld::RemoveFallenCars(void) for (int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) { CVehicle* veh = CPools::GetVehiclePool()->GetSlot(poolIndex); if (veh) { - if (veh->GetPosition().z < -100.0f) { + if (veh->GetPosition().z < MAP_Z_LOW_LIMIT) { if (veh->VehicleCreatedBy == MISSION_VEHICLE || veh == FindPlayerVehicle() || (veh->pDriver && veh->pDriver->IsPlayer())) { int closestNode = ThePaths.FindNodeClosestToCoors(veh->GetPosition(), PATH_CAR, 999999.9f, false, false); CVector newPos = ThePaths.m_pathNodes[closestNode].pos; diff --git a/src/core/World.h b/src/core/World.h index 119c6324..61a44ea0 100644 --- a/src/core/World.h +++ b/src/core/World.h @@ -22,6 +22,8 @@ #define WORLD_MAX_X (WORLD_MIN_X + WORLD_SIZE_X) #define WORLD_MAX_Y (WORLD_MIN_Y + WORLD_SIZE_Y) +#define MAP_Z_LOW_LIMIT -100.0f + enum { ENTITYLIST_BUILDINGS, @@ -103,11 +105,15 @@ public: 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 void FindObjectsOfTypeInRangeSectorList(uint32, CPtrList&, CVector&, float, bool, short*, short, CEntity**); + static void FindObjectsOfTypeInRange(uint32, CVector&, float, bool, short*, short, CEntity**, bool, bool, bool, bool, bool); static float FindGroundZForCoord(float x, float y); static float FindGroundZFor3DCoord(float x, float y, float z, bool *found); static float FindRoofZFor3DCoord(float x, float y, float z, bool *found); static void RemoveReferencesToDeletedObject(CEntity*); static void FindObjectsKindaColliding(const CVector &, float, bool, int16*, int16, CEntity **, bool, bool, bool, bool, bool); + static void FindObjectsIntersectingCube(const CVector &, const CVector &, int16*, int16, CEntity **, bool, bool, bool, bool, bool); + static void FindObjectsIntersectingAngledCollisionBox(const CColBox &, const CMatrix &, const CVector &, float, float, float, float, int16*, int16, CEntity **, bool, bool, bool, bool, bool); static float GetSectorX(float f) { return ((f - WORLD_MIN_X)/SECTOR_SIZE_X); } static float GetSectorY(float f) { return ((f - WORLD_MIN_Y)/SECTOR_SIZE_Y); } diff --git a/src/core/ZoneCull.cpp b/src/core/ZoneCull.cpp index 6d33a1cf..6b04c213 100644 --- a/src/core/ZoneCull.cpp +++ b/src/core/ZoneCull.cpp @@ -134,14 +134,16 @@ CCullZones::FindAttributesForCoors(CVector coors, int32 *wantedLevel) int i; int32 attribs; + if (wantedLevel) + *wantedLevel = 0; attribs = 0; for(i = 0; i < NumAttributeZones; i++) if(coors.x >= aAttributeZones[i].minx && coors.x <= aAttributeZones[i].maxx && coors.y >= aAttributeZones[i].miny && coors.y <= aAttributeZones[i].maxy && coors.z >= aAttributeZones[i].minz && coors.z <= aAttributeZones[i].maxz){ attribs |= aAttributeZones[i].attributes; - if(wantedLevel && *wantedLevel <= aAttributeZones[i].wantedLevel) - *wantedLevel = aAttributeZones[i].wantedLevel; + if(wantedLevel) + *wantedLevel = max(*wantedLevel, aAttributeZones[i].wantedLevel); } return attribs; } diff --git a/src/core/config.h b/src/core/config.h index 166c2a68..80176fca 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -85,6 +85,7 @@ enum Config { NUM_ACCIDENTS = 20, NUM_FIRES = 40, + NUM_GARAGES = 32, NUMPEDROUTES = 200, NUMPHONES = 50, |