summaryrefslogtreecommitdiffstats
path: root/src/control/RoadBlocks.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-05-05 17:04:18 +0200
committerSergeanur <s.anureev@yandex.ua>2020-05-05 17:04:18 +0200
commit9960c411933f9a804eb5f6840d75ad00fd255252 (patch)
tree19886c3263958d5c77664518270d252ad5554602 /src/control/RoadBlocks.cpp
parentMerge pull request #512 from Nick007J/master (diff)
downloadre3-9960c411933f9a804eb5f6840d75ad00fd255252.tar
re3-9960c411933f9a804eb5f6840d75ad00fd255252.tar.gz
re3-9960c411933f9a804eb5f6840d75ad00fd255252.tar.bz2
re3-9960c411933f9a804eb5f6840d75ad00fd255252.tar.lz
re3-9960c411933f9a804eb5f6840d75ad00fd255252.tar.xz
re3-9960c411933f9a804eb5f6840d75ad00fd255252.tar.zst
re3-9960c411933f9a804eb5f6840d75ad00fd255252.zip
Diffstat (limited to 'src/control/RoadBlocks.cpp')
-rw-r--r--src/control/RoadBlocks.cpp26
1 files changed, 0 insertions, 26 deletions
diff --git a/src/control/RoadBlocks.cpp b/src/control/RoadBlocks.cpp
index 322cc1df..1c0d9f96 100644
--- a/src/control/RoadBlocks.cpp
+++ b/src/control/RoadBlocks.cpp
@@ -15,40 +15,22 @@
#include "CarCtrl.h"
#include "General.h"
-#ifndef MIAMI
#define ROADBLOCKDIST (80.0f)
-#else
-#define ROADBLOCKDIST (90.0f)
-#endif
int16 CRoadBlocks::NumRoadBlocks;
-#ifndef MIAMI
int16 CRoadBlocks::RoadBlockObjects[NUMROADBLOCKS];
-#else
-int16 CRoadBlocks::RoadBlockNodes[NUMROADBLOCKS];
-#endif
bool CRoadBlocks::InOrOut[NUMROADBLOCKS];
-//--MIAMI: TODO: script roadblocks
void
CRoadBlocks::Init(void)
{
int i;
NumRoadBlocks = 0;
-#ifndef MIAMI
for (i = 0; i < ThePaths.m_numMapObjects; i++) {
if (ThePaths.m_objectFlags[i] & UseInRoadBlock) {
-#else
- for(i = 0; i < ThePaths.m_numCarPathNodes; i++){
- if(ThePaths.m_pathNodes[i].bUseInRoadBlock && ThePaths.m_pathNodes[i].numLinks == 2){
-#endif
if (NumRoadBlocks < NUMROADBLOCKS) {
InOrOut[NumRoadBlocks] = true;
-#ifndef MIAMI
RoadBlockObjects[NumRoadBlocks] = i;
-#else
- RoadBlockNodes[NumRoadBlocks] = i;
-#endif
NumRoadBlocks++;
} else {
#ifndef MASTER
@@ -128,19 +110,14 @@ CRoadBlocks::GenerateRoadBlocks(void)
int16 nRoadblockNode = (int16)(NUMROADBLOCKS * frame) / 16;
const int16 maxRoadBlocks = (int16)(NUMROADBLOCKS * (frame + 1)) / 16;
for (; nRoadblockNode < Min(NumRoadBlocks, maxRoadBlocks); nRoadblockNode++) {
-#ifndef MIAMI
CTreadable *mapObject = ThePaths.m_mapObjects[RoadBlockObjects[nRoadblockNode]];
CVector2D vecDistance = FindPlayerCoors() - mapObject->GetPosition();
-#else
- CVector2D vecDistance = FindPlayerCoors() - ThePaths.m_pathNodes[nRoadblockNode].GetPosition();
-#endif
if (vecDistance.x > -ROADBLOCKDIST && vecDistance.x < ROADBLOCKDIST &&
vecDistance.y > -ROADBLOCKDIST && vecDistance.y < ROADBLOCKDIST &&
vecDistance.Magnitude() < ROADBLOCKDIST) {
if (!InOrOut[nRoadblockNode]) {
InOrOut[nRoadblockNode] = true;
if (FindPlayerVehicle() && (CGeneral::GetRandomNumber() & 0x7F) < FindPlayerPed()->m_pWanted->m_RoadblockDensity) {
-#ifndef MIAMI
CWanted *pPlayerWanted = FindPlayerPed()->m_pWanted;
float fMapObjectRadius = 2.0f * mapObject->GetColModel()->boundingBox.max.x;
int32 vehicleId = MI_POLICE;
@@ -210,13 +187,10 @@ CRoadBlocks::GenerateRoadBlocks(void)
}
}
}
-#endif
}
}
} else {
InOrOut[nRoadblockNode] = false;
}
}
-
-//--MIAMI: TODO script roadblocks
}