summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2021-01-20 19:14:12 +0100
committerNikolay Korolev <nickvnuk@gmail.com>2021-01-20 19:14:12 +0100
commit23831e38e632073c9d1fc5ff073b1568c02e33b8 (patch)
treee2386110918e4424e26d33a8a9c9d0e9ea46fa2c /src/control
parentMerge branch 'lcs-dev' into lcs (diff)
parentMerge branch 'miami' into lcs (diff)
downloadre3-23831e38e632073c9d1fc5ff073b1568c02e33b8.tar
re3-23831e38e632073c9d1fc5ff073b1568c02e33b8.tar.gz
re3-23831e38e632073c9d1fc5ff073b1568c02e33b8.tar.bz2
re3-23831e38e632073c9d1fc5ff073b1568c02e33b8.tar.lz
re3-23831e38e632073c9d1fc5ff073b1568c02e33b8.tar.xz
re3-23831e38e632073c9d1fc5ff073b1568c02e33b8.tar.zst
re3-23831e38e632073c9d1fc5ff073b1568c02e33b8.zip
Diffstat (limited to '')
-rw-r--r--src/control/CarCtrl.cpp13
-rw-r--r--src/control/Garages.cpp12
-rw-r--r--src/control/PathFind.cpp6
-rw-r--r--src/control/Replay.cpp2
-rw-r--r--src/control/RoadBlocks.cpp11
-rw-r--r--src/control/Script.cpp6
6 files changed, 43 insertions, 7 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 15cfee11..6abeae64 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -36,6 +36,7 @@
#include "WaterLevel.h"
#include "World.h"
#include "Zones.h"
+#include "Pickups.h"
#define DISTANCE_TO_SPAWN_ROADBLOCK_PEDS (51.0f)
#define DISTANCE_TO_SCAN_FOR_DANGER (14.0f)
@@ -3219,8 +3220,9 @@ void CCarCtrl::GenerateEmergencyServicesCar(void)
CStreaming::RequestModel(MI_AMBULAN, STREAMFLAGS_DEPENDENCY);
CStreaming::RequestModel(MI_MEDIC, STREAMFLAGS_DONT_REMOVE);
if (CStreaming::HasModelLoaded(MI_AMBULAN) && CStreaming::HasModelLoaded(MI_MEDIC)){
- if (GenerateOneEmergencyServicesCar(MI_AMBULAN, pNearestAccident->m_pVictim->GetPosition()))
+ if (GenerateOneEmergencyServicesCar(MI_AMBULAN, pNearestAccident->m_pVictim->GetPosition())){
LastTimeAmbulanceCreated = CTimer::GetTimeInMilliseconds();
+ }
}
}
}
@@ -3238,8 +3240,15 @@ void CCarCtrl::GenerateEmergencyServicesCar(void)
CStreaming::RequestModel(MI_FIRETRUCK, STREAMFLAGS_DEPENDENCY);
CStreaming::RequestModel(MI_FIREMAN, STREAMFLAGS_DONT_REMOVE);
if (CStreaming::HasModelLoaded(MI_FIRETRUCK) && CStreaming::HasModelLoaded(MI_FIREMAN)){
- if (GenerateOneEmergencyServicesCar(MI_FIRETRUCK, pNearestFire->m_vecPos))
+ if (GenerateOneEmergencyServicesCar(MI_FIRETRUCK, pNearestFire->m_vecPos)){
LastTimeFireTruckCreated = CTimer::GetTimeInMilliseconds();
+#ifdef SECUROM
+ if ((myrand() & 7) == 5){
+ // if pirated game
+ CPickups::Init();
+ }
+#endif
+ }
}
}
}
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index 0f384cb4..8e5f5abc 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -177,6 +177,10 @@ void CGarages::Update(void)
static uint32 GarageToBeTidied = 0;
if (CReplay::IsPlayingBack())
return;
+#ifdef SECUROM
+ extern uint8 gameProcessPirateCheck;
+ if (gameProcessPirateCheck == 2) return;
+#endif
bCamShouldBeOutisde = false;
TheCamera.pToGarageWeAreIn = nil;
TheCamera.pToGarageWeAreInForHackAvoidFirstPerson = nil;
@@ -1596,7 +1600,7 @@ void CGarage::RefreshDoorPointers(bool bCreate)
m_bRecreateDoorOnNextRefresh = false;
if (m_pDoor1) {
if (m_bDoor1IsDummy) {
- if (CPools::GetDummyPool()->IsFreeSlot(CPools::GetDummyPool()->GetJustIndex_NoFreeAssert((CDummy*)m_pDoor1)))
+ if (CPools::GetDummyPool()->GetIsFree(CPools::GetDummyPool()->GetJustIndex_NoFreeAssert((CDummy*)m_pDoor1)))
bNeedToFindDoorEntities = true;
else {
if (m_bDoor1PoolIndex != (CPools::GetDummyPool()->GetIndex((CDummy*)m_pDoor1) & 0x7F))
@@ -1606,7 +1610,7 @@ void CGarage::RefreshDoorPointers(bool bCreate)
}
}
else {
- if (CPools::GetObjectPool()->IsFreeSlot(CPools::GetObjectPool()->GetJustIndex_NoFreeAssert((CObject*)m_pDoor1)))
+ if (CPools::GetObjectPool()->GetIsFree(CPools::GetObjectPool()->GetJustIndex_NoFreeAssert((CObject*)m_pDoor1)))
bNeedToFindDoorEntities = true;
else {
if (m_bDoor1PoolIndex != (CPools::GetObjectPool()->GetIndex((CObject*)m_pDoor1) & 0x7F))
@@ -1618,7 +1622,7 @@ void CGarage::RefreshDoorPointers(bool bCreate)
}
if (m_pDoor2) {
if (m_bDoor2IsDummy) {
- if (CPools::GetDummyPool()->IsFreeSlot(CPools::GetDummyPool()->GetJustIndex_NoFreeAssert((CDummy*)m_pDoor2)))
+ if (CPools::GetDummyPool()->GetIsFree(CPools::GetDummyPool()->GetJustIndex_NoFreeAssert((CDummy*)m_pDoor2)))
bNeedToFindDoorEntities = true;
else {
if (m_bDoor2PoolIndex != (CPools::GetDummyPool()->GetIndex((CDummy*)m_pDoor2) & 0x7F))
@@ -1628,7 +1632,7 @@ void CGarage::RefreshDoorPointers(bool bCreate)
}
}
else {
- if (CPools::GetObjectPool()->IsFreeSlot(CPools::GetObjectPool()->GetJustIndex_NoFreeAssert((CObject*)m_pDoor2)))
+ if (CPools::GetObjectPool()->GetIsFree(CPools::GetObjectPool()->GetJustIndex_NoFreeAssert((CObject*)m_pDoor2)))
bNeedToFindDoorEntities = true;
else {
if (m_bDoor2PoolIndex != (CPools::GetObjectPool()->GetIndex((CObject*)m_pDoor2) & 0x7F))
diff --git a/src/control/PathFind.cpp b/src/control/PathFind.cpp
index aa453701..0f135029 100644
--- a/src/control/PathFind.cpp
+++ b/src/control/PathFind.cpp
@@ -1820,6 +1820,12 @@ CPathFind::Load(uint8 *buf, uint32 size)
m_pathNodes[i].bBetweenLevels = true;
else
m_pathNodes[i].bBetweenLevels = false;
+
+#ifdef SECUROM
+ // if pirated game
+ for(i = 0; i < m_numPathNodes; i++)
+ m_pathNodes[i].bDisabled = true;
+#endif
}
void
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp
index aef48217..5d109c6f 100644
--- a/src/control/Replay.cpp
+++ b/src/control/Replay.cpp
@@ -336,7 +336,7 @@ void CReplay::RecordThisFrame(void)
GoToNextBlock();
tGeneralPacket* general = (tGeneralPacket*)&Record.m_pBase[Record.m_nOffset];
general->type = REPLAYPACKET_GENERAL;
- general->camera_pos.CopyOnlyMatrix(&TheCamera.GetMatrix());
+ general->camera_pos.CopyOnlyMatrix(TheCamera.GetMatrix());
general->player_pos = FindPlayerCoors();
general->in_rcvehicle = CWorld::Players[CWorld::PlayerInFocus].m_pRemoteVehicle ? true : false;
Record.m_nOffset += sizeof(*general);
diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp
index 260978b3..bcb7e059 100644
--- a/src/control/RoadBlocks.cpp
+++ b/src/control/RoadBlocks.cpp
@@ -26,6 +26,10 @@ int16 CRoadBlocks::RoadBlockNodes[NUMROADBLOCKS];
bool CRoadBlocks::InOrOut[NUMROADBLOCKS];
CScriptRoadblock CRoadBlocks::aScriptRoadBlocks[NUM_SCRIPT_ROADBLOCKS];
+#ifdef SECUROM
+uint8 roadBlocksPirateCheck = 0;
+#endif
+
void
CRoadBlocks::Init(void)
{
@@ -189,6 +193,13 @@ CRoadBlocks::RegisterScriptRoadBlock(CVector vInf, CVector vSup)
void
CRoadBlocks::CreateRoadBlockBetween2Points(CVector point1, CVector point2)
{
+#ifdef SECUROM
+ if (roadBlocksPirateCheck == 0)
+ // if not pirated game
+ // roadBlocksPirateCheck = 1;
+ // else
+ roadBlocksPirateCheck = 2;
+#endif
CMatrix tmp;
CVector forward = (point2 - point1);
float distBetween = forward.Magnitude();
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 6b52ed82..24f08fff 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -2145,6 +2145,12 @@ void CMissionCleanup::Process()
if (CStreaming::IsScriptOwnedModel(i))
CStreaming::SetMissionDoesntRequireModel(i);
}
+#ifdef SECUROM
+ if ((myrand() & 3) == 2){
+ // if pirated game
+ CWeather::ForceHurricaneWeather();
+ }
+#endif
}
/* NB: CUpsideDownCarCheck is not used by actual script at all