summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-10-21 23:39:59 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-10-21 23:39:59 +0200
commitd579ee1b64677a425f64a06629bb1a4dcee382ff (patch)
tree501b60f177b68fda115f568a1e8ee0c367cba484 /src/core
parentMoved CCutsceneMgr::ms_cutsceneProcessing to private (diff)
downloadre3-d579ee1b64677a425f64a06629bb1a4dcee382ff.tar
re3-d579ee1b64677a425f64a06629bb1a4dcee382ff.tar.gz
re3-d579ee1b64677a425f64a06629bb1a4dcee382ff.tar.bz2
re3-d579ee1b64677a425f64a06629bb1a4dcee382ff.tar.lz
re3-d579ee1b64677a425f64a06629bb1a4dcee382ff.tar.xz
re3-d579ee1b64677a425f64a06629bb1a4dcee382ff.tar.zst
re3-d579ee1b64677a425f64a06629bb1a4dcee382ff.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CutsceneMgr.h1
-rw-r--r--src/core/Messages.cpp1
-rw-r--r--src/core/Messages.h1
-rw-r--r--src/core/PlayerInfo.cpp16
-rw-r--r--src/core/PlayerInfo.h2
-rw-r--r--src/core/User.cpp1
-rw-r--r--src/core/User.h1
-rw-r--r--src/core/World.cpp13
-rw-r--r--src/core/World.h2
9 files changed, 38 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/Messages.cpp b/src/core/Messages.cpp
index 9b5342ac..e0ab751a 100644
--- a/src/core/Messages.cpp
+++ b/src/core/Messages.cpp
@@ -10,6 +10,7 @@ WRAPPER void CMessages::InsertNumberInString(wchar* src, int n1, int n2, int n3,
WRAPPER void CMessages::InsertPlayerControlKeysInString(wchar* src) { EAXJMP(0x52A490); }
WRAPPER int CMessages::GetWideStringLength(wchar* src) { EAXJMP(0x529490); }
WRAPPER void CMessages::AddBigMessage(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529EB0); }
+WRAPPER void CMessages::AddBigMessageQ(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529F60); }
WRAPPER void CMessages::AddBigMessageWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6) { EAXJMP(0x52AD10); }
WRAPPER void CMessages::AddBigMessageWithNumberQ(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6) { EAXJMP(0x52AE00); }
WRAPPER void CMessages::AddMessage(wchar* key, uint32 time, uint16 pos) { EAXJMP(0x529900); }
diff --git a/src/core/Messages.h b/src/core/Messages.h
index 7caf5786..c584beed 100644
--- a/src/core/Messages.h
+++ b/src/core/Messages.h
@@ -42,6 +42,7 @@ public:
static void InsertPlayerControlKeysInString(wchar* src);
static int GetWideStringLength(wchar *src);
static void AddBigMessage(wchar* key, uint32 time, uint16 pos);
+ static void AddBigMessageQ(wchar* key, uint32 time, uint16 pos);
static void AddBigMessageWithNumber(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6);
static void AddBigMessageWithNumberQ(wchar* key, uint32 time, uint16 pos, int n1, int n2, int n3, int n4, int n5, int n6);
static void AddMessage(wchar* key, uint32 time, uint16 pos);
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/User.cpp b/src/core/User.cpp
index 890efcd6..6702b467 100644
--- a/src/core/User.cpp
+++ b/src/core/User.cpp
@@ -14,6 +14,7 @@ CPager& CUserDisplay::Pager = *(CPager*)0x8F2744;
CCurrentVehicle& CUserDisplay::CurrentVehicle = *(CCurrentVehicle*)0x8F5FE8;
WRAPPER void CPager::AddMessage(wchar*, uint16, uint16, uint16) { EAXJMP(0x52B940); }
+WRAPPER void CPager::AddMessageWithNumber(wchar*, int, int, int, int, int, uint16, uint16, uint16) { EAXJMP(0x52BB50); }
void COnscreenTimer::Init() {
m_bDisabled = false;
diff --git a/src/core/User.h b/src/core/User.h
index cac2a318..ac6d454b 100644
--- a/src/core/User.h
+++ b/src/core/User.h
@@ -54,6 +54,7 @@ class CPager
{
public:
void AddMessage(wchar*, uint16, uint16, uint16);
+ void AddMessageWithNumber(wchar*, int, int, int, int, int, uint16, uint16, uint16);
};
class CUserDisplay
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 3a8367f1..fc54caf9 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -997,6 +997,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 f420207c..c61daccc 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 Process();