summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorerorcun <erayorcunus@gmail.com>2019-10-30 01:20:15 +0100
committerGitHub <noreply@github.com>2019-10-30 01:20:15 +0100
commit34090ab4d6c0d23d3955e8f85d8d97a2887af838 (patch)
tree7aaf5fd5359ad3f93ee2ee6e194d507c1d87c64a /src/core
parentCRadar::Initialise() + fixes (diff)
parentfix pager build (diff)
downloadre3-34090ab4d6c0d23d3955e8f85d8d97a2887af838.tar
re3-34090ab4d6c0d23d3955e8f85d8d97a2887af838.tar.gz
re3-34090ab4d6c0d23d3955e8f85d8d97a2887af838.tar.bz2
re3-34090ab4d6c0d23d3955e8f85d8d97a2887af838.tar.lz
re3-34090ab4d6c0d23d3955e8f85d8d97a2887af838.tar.xz
re3-34090ab4d6c0d23d3955e8f85d8d97a2887af838.tar.zst
re3-34090ab4d6c0d23d3955e8f85d8d97a2887af838.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CutsceneMgr.h1
-rw-r--r--src/core/PlayerInfo.cpp16
-rw-r--r--src/core/PlayerInfo.h2
-rw-r--r--src/core/World.cpp13
-rw-r--r--src/core/World.h2
5 files changed, 34 insertions, 0 deletions
diff --git a/src/core/CutsceneMgr.h b/src/core/CutsceneMgr.h
index 8c4a918b..e95a2a04 100644
--- a/src/core/CutsceneMgr.h
+++ b/src/core/CutsceneMgr.h
@@ -31,6 +31,7 @@ public:
static CCutsceneObject* GetCutsceneObject(int id) { return ms_pCutsceneObjects[id]; }
static int GetCutsceneTimeInMilleseconds(void) { return 1000.0f * ms_cutsceneTimer; }
static char *GetCutsceneName(void) { return ms_cutsceneName; }
+ static void SetCutsceneOffset(const CVector& vec) { ms_cutsceneOffset = vec; }
static bool HasCutsceneFinished(void);
static void Initialise(void);
diff --git a/src/core/PlayerInfo.cpp b/src/core/PlayerInfo.cpp
index be2c0687..f0b7d444 100644
--- a/src/core/PlayerInfo.cpp
+++ b/src/core/PlayerInfo.cpp
@@ -72,6 +72,22 @@ CPlayerInfo::ArrestPlayer()
CStats::TimesArrested++;
}
+bool
+CPlayerInfo::IsPlayerInRemoteMode()
+{
+ return m_pRemoteVehicle || m_bInRemoteMode;
+}
+
+void
+CPlayerInfo::PlayerFailedCriticalMission()
+{
+ if (m_WBState != WBSTATE_PLAYING)
+ return;
+ m_WBState = WBSTATE_FAILED_CRITICAL_MISSION;
+ m_nWBTime = CTimer::GetTimeInMilliseconds();
+ CDarkel::ResetOnPlayerDeath();
+}
+
STARTPATCHES
InjectHook(0x4A1700, &CPlayerInfo::LoadPlayerSkin, PATCH_JUMP);
InjectHook(0x4A1750, &CPlayerInfo::DeletePlayerSkin, PATCH_JUMP);
diff --git a/src/core/PlayerInfo.h b/src/core/PlayerInfo.h
index 5784e1fb..ef21fb52 100644
--- a/src/core/PlayerInfo.h
+++ b/src/core/PlayerInfo.h
@@ -75,6 +75,8 @@ public:
void Process(void);
void KillPlayer(void);
void ArrestPlayer(void);
+ bool IsPlayerInRemoteMode(void);
+ void PlayerFailedCriticalMission(void);
};
static_assert(sizeof(CPlayerInfo) == 0x13C, "CPlayerInfo: error");
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 5dea09bd..ae0d67cc 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -999,6 +999,19 @@ CWorld::RemoveFallenCars(void)
}
void
+CWorld::StopAllLawEnforcersInTheirTracks(void)
+{
+ int poolSize = CPools::GetVehiclePool()->GetSize();
+ for (int poolIndex = poolSize - 1; poolIndex >= 0; poolIndex--) {
+ CVehicle* veh = CPools::GetVehiclePool()->GetSlot(poolIndex);
+ if (veh) {
+ if (veh->bIsLawEnforcer)
+ veh->SetMoveSpeed(0.0f, 0.0f, 0.0f);
+ }
+ }
+}
+
+void
CWorld::Process(void)
{
if (!(CTimer::GetFrameCounter() & 63))
diff --git a/src/core/World.h b/src/core/World.h
index a1aa0376..3b04403e 100644
--- a/src/core/World.h
+++ b/src/core/World.h
@@ -120,6 +120,8 @@ public:
static void RemoveFallenPeds();
static void RemoveFallenCars();
+ static void StopAllLawEnforcersInTheirTracks();
+
static void Initialise();
static void ShutDown();
static void RepositionCertainDynamicObjects();